CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 15 of 17

Threaded View

  1. #11
    Join Date
    Apr 2013
    Posts
    12

    Re: Calculation Problems

    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.

    http://www.jcitech.net/Images-ForumPosts/Lab6C-Dollars.txt is my old code (working in dollars and cents).

    http://www.jcitech.net/Images-ForumPosts/Lab6C-Pennies.txt 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

    Objectives
    To learn to code, compile and run a program containing three or more functions. This is a catering company.

    Assignment
    Plan and code a program utilizing one file for input and one file for output to solve the following problem:
    • 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.
    • 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).
    • All customers will be charged the same rate for tip and tax, currently 18 percent (applied only to the cost of the food).
    • To induce customers to pay promptly, a discount is offered if payment is made within ten days.
    • 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.

    Input
    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.

    Data File
    http://www.jcitech.net/Images-ForumPosts/Lab6CDataFile-Input.txt

    Output
    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.

    Turn in
    Top down design with parameters, program listing and program output. Turn in all data files used in the program.

    Question:
    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?
    Last edited by justasiam; April 26th, 2013 at 12:07 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured