Purchase Solution

The Twelve Days of Christmas Program

Not what you're looking for?

Ask Custom Question

Here is the problem. The Twelve Days of Christmas. Each year, PNC Advisors of Pittsburgh publishes a Christmas Price List. See Table 6.11. Write a program that requests am integer from 1 through 12 and then lists the gifts for that day along with the day's cost. On the nth, day, the n gifts are 1 partridge in a pear tree, 2 turtle doves,...., n of the nth item. The program also should give the total cost of all twelve days. As an example, the output in the list box when the user enters 3 is shown below.

Christmas Price List for 2001
Item Cost Item Cost
partridge in a pear tree 140.00 swan-a-swimming 500.00
turtle dove 29.00 maid-a-milking 5.15
French hen 5.00 lady dancing 446.58
calling bird 79.00 lord-a-leaping 377.06
gold ring 75.00 piper piping 146.78
geese-a-laying 25.00 drummer drumming 145.76

The gifts for day 3 are
1 partridge in a pear tree
2 turtle doves
3 french hens
Cost $213.00
Total Cost for the twelve days : $62,934.96

Purchase this Solution

Solution Summary

This solution provides a Java file that consists of a program that requests am integer from 1 through 12 and then lists the gifts for that day along with the day's cost.

Purchase this Solution


Free BrainMass Quizzes
Excel Introductory Quiz

This quiz tests your knowledge of basics of MS-Excel.

Java loops

This quiz checks your knowledge of for and while loops in Java. For and while loops are essential building blocks for all Java programs. Having a solid understanding of these constructs is critical for success in programming Java.

C++ Operators

This quiz tests a student's knowledge about C++ operators.

Basic UNIX commands

Use this quiz to check your knowledge of a few common UNIX commands. The quiz covers some of the most essential UNIX commands and their basic usage. If you can pass this quiz then you are clearly on your way to becoming an effective UNIX command line user.

Word 2010: Table of Contents

Ever wondered where a Table of Contents in a Word document comes from? Maybe you need a refresher on the topic? This quiz will remind you of the keywords and options used when working with a T.O.C. in Word 2010.