Find the answer to your Linux question:
Results 1 to 2 of 2
I have this program and i really dont even know where to begin because our teacher doesnt explain anything so i dont know how to make a chart of this ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Oct 2005
    Posts
    2

    plz Help with a c++ program using g++ compiler


    I have this program and i really dont even know where to begin because our teacher doesnt explain anything so i dont know how to make a chart of this data. He said use the set(w) to make it look like a chart but i dont even know how the prog should be written can anyone help plz?

    Programming Assignment 5
    A catering service has the following schedule of charges for meals that it serves to groups and discounts according to how many were ordered:

    Meal
    Cost Each
    Discount
    If order more than

    Breakfast
    $5.50
    10%
    10

    Lunch
    $9.50
    15%
    15

    Dinner
    $16.50
    12%
    8

    Write a C++ program that reads the number of each meal ordered. Then do the computations and print results as indicated below. The program should compute, for each category, the cost of the meals received in each category, the discount, and the final cost of the meals. It should then compute the total cost of all meals, add a 10% sates tax and print the total due. Be sure to format the output. No loop is necessary.



    Make your output is attractive and include appropriate comments in your program. Below is an example of what the inputs and output of the program should look like.



    For each meal, Cost Each, Discount, and If order more than should be constants. The calculation of the discount HAS to be done in a function. There should be only 1 function to calculate all three different meal types. The function prototype will look like this:



    double calcCommission (int quantity, double costEach, double discountPerCent, int orderMoreThan);



    Enter the number of Breakfasts ordered: 30
    Enter the number of Lunches ordered: 28
    Enter the number of Dinners ordered: 25

    My Favorite Catering Service

    ***********************************************

    Meal
    Quantity
    Cost
    Discount
    Cost After Discount

    Breakfast
    30
    165.00
    16.50
    148.50

    Lunch
    28
    266.00
    39.90
    226.10

    Dinner
    25
    412.50
    49.50
    363.00


    Total
    737.60

    Sales Tax
    73.76

    Total Due
    811.36
    _________________________________________________

    and i have this so far... not sure where else to go..

    #include <iostream>
    #include <iomanip>
    using namespace std;

    double calcCommission (int quantity, double costEach, double discountPerCent, int ifOrderMoreThan);

    int main ( )
    {
    int breakfast, lunch, dinner;
    double costEach, discount, ifOrderMoreThan;

  2. #2
    Linux Newbie
    Join Date
    Apr 2005
    Location
    South America
    Posts
    152
    Dont wanna leave you in the blue... but I missed the point where these forums where about making your homework

Posting Permissions

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