I just want to say that I am so tired of not understand any single word that comes out of my instructor’s mouth. After talking with an advisor, I learned that I am in a wrong Computer Science I class since there is 2 other classes that should be taken prior to a Computer Science class which make no sense because the course state’s that it’s an “Introduction to Computer Science” and the textbook states “No prior knowledge needed” and that the reading the material is easily understood. That’s a bold out lie. Anyways, the instructor (even with great programming knowledge) is terrible with his ‘I don’t give a shit about your life’ attitude he gives off when I try to explain to him my situation. Sad to say that I have to pass this class, otherwise I am no longer eligible for Financial Aid plus I am no longer getting paid by the Vet program for attending school. I tried listening to class, read every single chapter so far and stayed after class and ask the instructor a lot of questions and still retaining any information in my head. The instructor gave me the formula for the previous assignments so I did it on my own did well but the problem is that I’m not learning anything. For this assignment, it is way too confusing to understand and unsure where to even start. I’m going to list below the assignment info and I hope someone can help me code this. It’s my last resort to feel like I’m cheating, but it’s my life that I have to control before I get denied of any future education.
Assignment:
Write a program to calculate the bill for an ice cream and candy store. This assignment is an extension of assignment 2, with the addition of choices of flavors and extras for ice cream, so you can use assignment 2 as the basis for this assignment. Your program will tell the user how much a scoop of vanilla, strawberry, and chocolate ice cream costs, and then ask them how many scoops they would like to order. In addition, the user will be able to select whipped cream, hot fudge sauce, or sprinkles for their ice cream. Extras are calculated per scoop, so multiply the cost of the extras by the number of scoops. Then ask the customer if they would like any lollypops and/or gumdrops. After the user makes their selection, your program will print out an itemized receipt, and a total bill at the bottom. This time though, if the user does not select an item, it should not appear on the receipt. You may handle this two ways: by asking if they would like an item and allow them to say yes or no, or by asking how many of an item they would like. If the user says no or if they say zero for any item, then it should not appear on the receipt. Therefore, no item should cost $0.00, with the exception of the grand total if no items are ordered. Please see the sample output sections for details.
Here are the prices for the items listed above:
Ice Cream Other Items
1 Scoop of Vanilla Ice cream $1.15 1 Lollypop $0.79
1 Scoop of Strawberry Ice cream $1.20 1 Package of Gumdrops $0.55
1 Scoop of Chocolate Ice cream $1.25
Extras
Sprinkles, 15¢ per scoop.
Hot Fudge, 20¢ per scoop.
Whipped Cream, 10¢ per scoop.
Sample Output 1 (user input is in bold):
Welcome to Rob’s Ice Cream and Candy Store!
Vanilla ice cream scoops are $1.15, strawberry scoops are $1.20, and
Chocolate scoops are $1.25. How many scoops would you like?: 2
What flavor would you like? (V)anilla, (S)trawberry or (C)hocolate: S
Sprinkles are $0.15 per scoop. Would you like sprinkles?(Y or N): Y
Hot Fudge is $.20 per scoop. Would you like hot fudge?(Y or N): N
Whipped Cream is $0.10 per scoop. Would you like whipped cream?(Y or N): Y
Lollypops are $0.79. Would you like some lollypops? (Y or N): Y
How many lollypops would you like?: 2
Gumdrops are $0.55. Would you like some gumdrops? (Y or N): N
-------------------------------------
Thank you for your order:
2 scoops of strawberry ice cream at $1.20 per scoop.
Ice cream extras:
Sprinkles, $0.15 per scoop.
Whipped Cream, $0.10 per scoop.
Charge for ice cream and extras: $2.90.
2 lollypops at $0.79, charge $1.58.
Total Charge: $3.48.
-------------------------------------
Thanks for your order, Enjoy!
Sample Output 2 (user input is in bold):
Welcome to Rob’s Ice Cream and Candy Store!
Vanilla ice cream scoops are $1.15, strawberry scoops are $1.20, and
Chocolate scoops are $1.25. How many scoops would you like?: 0
Lollypops are $0.79. Would you like some lollypops? (Y or N): Y
How many lollypops would you like?: 2
Gumdrops are $0.55. Would you like some gumdrops? (Y or N): Y
How many gumdrops would you like?: 3
-------------------------------------
Thank you for your order:
2 lollypops at $0.79, charge $1.58.
3 gumdrops at $0.55, charge $1.65.
Total Charge: $3.23.
-------------------------------------
Thanks for your order, Enjoy!
Sample Output 3 (user input is in bold):
Welcome to Rob’s Ice Cream and Candy Store!
Vanilla ice cream scoops are $1.15, strawberry scoops are $1.20, and
Chocolate scoops are $1.25. How many scoops would you like?: 2
What flavor would you like? (V)anilla, (S)trawberry or (C)hocolate: V
Sprinkles are $0.15 per scoop. Would you like sprinkles?(Y or N): N
Hot Fudge is $.20 per scoop. Would you like hot fudge?(Y or N): N
Whipped Cream is $0.10 per scoop. Would you like whipped cream?(Y or N): N
Lollypops are $0.79. Would you like some lollypops? (Y or N): N
Gumdrops are $0.55. Would you like some gumdrops? (Y or N): N
-------------------------------------
Thank you for your order:
2 scoops of vanilla ice cream at $1.15 per scoop.
Charge for ice cream and extras: $2.30.
Total Charge: $2.30.
-------------------------------------
Thanks for your order, Enjoy!
Ah, don't worry about it. Thank you for your help GreenLeaf. I used your formula along with my previous assignment to help guide me. I didn't want to copy and past since there is a lot of terms I did not learn/remember in class yet. Here is my finished one:
cout << "Would you like some Lollypops? $0.79 each (Y or N): ";
cin >> choice;
if(choice == 'Y' || choice == 'y')
{
cout << "How many Lollypops do you want? ";
cin >> lollypops;
lollypopsTotal = lollypops * lollypopsCost;
cout << "Total for Lollypops: $" << lollypopsTotal << endl;
}
else
lollypopsTotal = 0.0;
cout << "Would you like some Gumdrops? $0.55 each (Y or N): ";
cin >> choice;
if(choice == 'Y' || choice == 'y' )
{
cout << "How many Gumdrops do you want? ";
cin >> gumdrops;
gumdropsTotal = gumdrops * gumdropsCost;
cout << "Total for Gumdrops: $" << gumdropsTotal << endl;
}
else
gumdropsTotal = 0.0;
saleTotal = icescreamscoopsTotal + CHOCOLATE + STRAWBERRY + VANILLA + lollypopsTotal+ gumdropsTotal;
cout << "Grand Total of $" << saleTotal << ". Thank you very much for shopping. Have a nice day!" << endl;
cout << "Enter q to quit...";
cin >> reply;
return 0;
}