The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | May 2017 |
| Last Sign in: | 398 Weeks Ago, 2 Days Ago |
| Questions Answered: | 66690 |
| Tutorials Posted: | 66688 |
MCS,PHD
Argosy University/ Phoniex University/
Nov-2005 - Oct-2011
Professor
Phoniex University
Oct-2001 - Nov-2016
Java: Hello anyone I'm in need of help on a programming question which must be done within the next 6 hours. Write a program to calculate the Twelve Days Of Christmas. The program requests a integer from 1-12 and then lists the gift for that day and the costs. the program should also calculate the total cost of all 12 days. If bad data is entered an error message SHOULD occur and no calculation should be performed. If everything is entered correctly then it should look like this:
User input:3
Your gifts for Day 3 are:
One partridge in a pear tree
two turtle doves
three French hen
cost of day: $459.99
total cost for twelve days:
$ 101,099.96
The program has to be a looping for calculations not using printing. Data also HAS to be loaded by a text file. Also use array. The text file should look something like:
(first text file)
One Partridge in a Pear Tree
Two Turtle Doves
Three French Hen
Four Calling Birds
Five Golden Rings
Six Geese-a-Laying
Seven Swans-a-Swimming
Eight Maids-a-Milking
Nine Ladies Dancing
Ten Lords-a-Leaping
Eleven Pipers Piping
Twelve Drummers Drumming
(Text File two)
184.99
62.50
50.00
129.99
129.00
27.00
900.00
7.25
699.34
476.67
220.69
219.16
The grand total should be $101,099.96
Hel-----------lo -----------Sir-----------/Ma-----------dam-----------Tha-----------nk -----------You----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------and----------- ac-----------qui-----------sit-----------ion----------- of----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n.P-----------lea-----------se -----------pin-----------g m-----------e o-----------n c-----------hat----------- I -----------am -----------onl-----------ine----------- or----------- in-----------box----------- me----------- a -----------mes-----------sag-----------e I----------- wi-----------ll