Find Jobs
Hire Freelancers

169557 Simple C++ Program

N/A

Fullført
Lagt ut over 16 år siden

N/A

Betalt ved levering
Program needs to be done before 10/4/2007 You have been hired by Mrs. Bow, the owner of Rainbow Ice Cream, to write a program that will calculate sales, track inventory, and produce report. Mrs. Bow carries three types of homemade ice cream: chocolate deluxe, vanilla special, and strawberry burst. She can only make 40 chocolate deluxe (C), 50 vanilla special (V), and 35 strawberry burst (S) in one day. All of her ice cream are made fresh daily and will be discarded at the end of the day if she does not sell them. The cost for chocolate deluxe is $0.50, vanilla special is $0.50, and strawberry burst is $0.65. She sells all of them at $2.25 each. Your program should begin by displaying a menu listing all types of ice cream that Mrs. Bow carries. You will allow Mrs. Bow to enter the type of ice cream that a client wants and the number of ice cream that the client wants. The program will check for availability of the ice cream and display appropriate message. Three possible scenarios are: (1) Mrs. Bow has enough ice cream to sell. The message that you display should include the price of total sales. (2) Mrs. Bow can only fulfill partial sales, e.g. client would like to buy four chocolate deluxe and she only has one left. In this situation, she would like the program to tell her how many ice creams she could sell and how much she should charge the customer. She also would like the program to keep track of the amount that is short so she can do sales planning in the future. (3) Mrs. Bow is completely out of stock on the particular ice cream. She would like the program to display a message stating the situation and keep track of the amount that is short so she can do sales planning in the future. Your program should allow Mrs. Bow to process as many transactions as she wants until she presses a capital Z at the end of the day. When Mrs. Bow decides to stop processing another transaction, your program will display a business report stating the number of ice creams sold for each type of ice cream, total sales for each type of ice cream, and the number of ice creams left in the freezer. If an ice cream is out of stock, your program will also list the total number Mrs. Bow is unable to supply to all of her customers. In addition, your program will also calculate the net profit that Mrs. Bow makes taking into consideration the cost of each ice cream sold, and the cost of left over ice cream that she would have to throw away. In addition, your program should also check for invalid input, for example, if Mrs. Bow types in P as one of the ice cream types, your program should display an error message and re-iterate until a correct ice cream type is entered. You can assume all character input will be entered using upper case letter. ** Test your program thoroughly; you will be graded on your program output. Useful Pointers: 1. This is a much longer program compared to your first one. Write a small section, then compile and run. This way, when you encounter problem later in the process, you will know which part is already working. Do not write the entire program then try to compile all at once, especially if you are new to programming. 2. Don't panic if you see many error messages, try to pick one and correct it. Usually, error comes from common mistakes like missing semicolon, un-matched braces { } or undeclared variable. It is always easier to debug on a piece of paper than on the screen when the program is longer than one screen length. If you are using Visual C++, double click on the error will bring the cursor to the part of the program where the potential error occurs. The error is usually on the same line where the cursor is or on the line before that. 3. If the output is incorrect, trace your program either on a piece of paper or try putting some cout statements to see the value of your variable, output the value to the terminal. This way, you can debug the program one step at a time. Remember, this is a top down design, so, you can't output what you haven't calculate, and if something is wrong in the later part, it is usually an error in the part before that. !! Start early and follow the assignment guidelines to turn in your assignment. Sample output shows a subset of possible outputs, your program should be able to perform all of the requirements provided. Sample Output: Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : A Incorrect type ! Please re-enter ! Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : V Please enter the number needed : 20 20 Vanilla Special, $45.00 Would you like to process another transaction ? : Y Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : V Please enter the number needed : 10 10 Vanilla Special, $22.50 Would you like to process another transaction ? : Y Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : S Please enter the number needed : 35 35 Strawberry Burst, $78.75 Would you like to process another transaction ? : Y Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : C Please enter the number needed : 30 30 Chocolate Deluxe, $67.50 Would you like to process another transaction ? : Y Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : S Please enter the number needed : 5 Sorry, out of stock ! Would you like to process another transaction ? : Y Welcome to Rainbow Ice Cream ============================ C - Chocolate Deluxe V - Vanilla Special S - Strawberry Burst Please select the type of ice cream : C Please enter the number needed : 19 Only 10 Chocolate Deluxe available, $22.50 Would you like to process another transaction ? : Z REPORT : Sold In stock Needed Sales Profit Chocolate Deluxe : 40 0 9 90.00 70.00 Vanilla Special : 30 20 0 67.50 42.50 Strawberry Burst : 35 0 5 78.75 56.00 Grand Total : 105 20 14 236.25 168.50 Press any key to continue . . .
Prosjekt-ID: 1915756

Om prosjektet

1 forslag
Eksternt prosjekt
Aktiv 12 år siden

Ønsker du å tjene penger?

Fordeler med budgivning på Freelancer

Angi budsjettet og tidsrammen
Få betalt for arbeidet ditt
Skisser forslaget ditt
Det er gratis å registrere seg og by på jobber
Tildelt til:
Brukeravatar
please see the pmb.. thanks
$15 USD om 1 dag
0,0 (0 omtaler)
0,0
0,0

Om klienten

s flagg
5,0
5
Medlem siden feb. 2, 2007

Klientbekreftelse

Takk! Vi har sendt deg en lenke for at du skal kunne kreve din gratis kreditt.
Noe gikk galt. Vær så snill, prøv på nytt.
Registrerte brukere Publiserte jobber
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Forhåndsvisning innlasting
Tillatelse gitt for geolokalisering.
Påloggingsøkten din er utløpt og du har blitt logget ut. Logg på igjen.