I hear what you are saying. Let me give you the exact wording of the assignment and then links to my code. I would post the entire code here, but there are too many characters for this post to hold it.
is my old code (working in dollars and cents).
is the new code (working in pennies and converting everything to pennies).
The Output Data File is at http://www.jcitech.net/Images-ForumPosts/Lab6CDataFile-Output.txt
The Output Error file is at http://www.jcitech.net/Images-ForumPosts/Lab6CDataFile-Error.txt
CSIT 575 – Programming Fundamentals for Computer Science Lab #6C
To learn to code, compile and run a program containing three or more functions. This is a catering company.
Plan and code a program utilizing one file for input and one file for output to solve the following problem:
(A) For adults, the deluxe meals will cost $25.80 per person and the standard meals will cost $21.75 per person, dessert included. Children's meals will cost 60 percent of adult meals. Everyone within a given party must be served the same meal type.
(B) A surcharge, currently 7 percent, is added to the total bill if the catering is to be done on the weekend (Friday, Saturday, or Sunday).
(C) All customers will be charged the same rate for tip and tax, currently 18 percent (applied only to the cost of the food).
(D) To induce customers to pay promptly, a discount is offered if payment is made within ten days.
(E) This discount depends on the amount of the total bill. If the bill is less than $100.00, the discount is 1.5 percent; if the bill is at least $100.00 but less than $400.00, the discount is 2.5 percent; if the bill is $400.00 or more, the discount is 3.5 percent.
Number of adults, number of children, meal type (D, S) character indicating whether or not date is a weekend (Y/N), amount of any deposit. Create the data file below in text editor or Notepad.
Output an itemized bill listing the number of adults, children, cost for adult meals, cost for children's meals, total food cost, surcharge (if appropriate), tax and tip, total cost of the party, deposit (if any), total balance due, amount of discount if bill if paid within ten days. Output error data to a separate error file.
Top down design with parameters, program listing and program output. Turn in all data files used in the program.
Since this is not a banking problem, I don't need that level of accuracy. Is there a way to look at the hundredth place on a decimal value and if it is > 4, then add 1 to the tenth place?