Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Lab 3 icecream.cpp
- // This progrma generates an ice cream sales report
- // David Hawkins
- // INCLUDE ANY NEEDED FILES HERE.
- #include <iostream>
- #include <string>
- using namespace std;
- int main()
- {
- // DEFINE NAMED CONSTANTS HERE TO HOLD THE PRICES OF THE 3
- float x = 1.49; // price of a single scoop
- float y = 2.49; // price of a doublescoop
- float z = 3.49; // price of a triple scoop
- // SIZES OF ICE CREAM CONES. GIVE EACH ONE A DESCRIPTIVE
- // NAME AND AN APPROPRIATE DATA TYPE.
- int onescoop;
- int twoscoop;
- int threescoop;
- int choice;
- // DECLARE ALL NEEDED VARIABLES HERE. GIVE EACH ONE A DESCRIPTIVE
- // NAME AND AN APPROPRIATE DATA TYPE.
- // WRITE STATEMENTS HERE TO PROMPT FOR AND INPUT THE INFORMATION
- // THE PROGRAM NEEDS TO GET FROM THE USER.
- while (true)
- {
- cout << "Choose the Size do want to enter sale data for?\n1: Single Scoop\n2: Double Scoop\n3: Triple Scoop\n4: Print Report\n5: Exit Program";
- cin >> choice;
- if (choice == 1)
- {
- cout << "How many single scoop cones did you sell? ";
- cin >> onescoop;
- }
- else if (choice == 2)
- {
- cout << "How many double scoop cones did you sell? ";
- cin >> twoscoop;
- }
- else if (choice == 3)
- {
- cout << "How many triple scoop cones did you sell? ";
- cin >> threescoop;
- }
- else if (choice == 4)
- {
- cout << " Ice Cream Sales Report \n";
- cout << left << setw(28) << "Type of Cone" << right << setw(6) << "quant" << setw(10) << "Total Sales";
- cout << "=================================";
- cout << left << setw(30) << "Delightful cones" << right << setw(4) << onescoop << setw(10) << x * onescoop;
- cout << left << setw(30) << "Double Delight cones" << right << setw(4) << twoscoop << setw(10) << y * twoscoop;
- cout << left << setw(30) << "Triple Deleight conse" << right << setw(4) << threescoop << setw(10) << z * threescoop;
- cout << ; left << setw(30) << "Total" << right << setw(4) << onescoop + twoscoop + threescoop << setw(10) << (x * onescoop) + (y * twoscoop) + (z * threescoop);
- cout << endl;
- }
- else if (choice == 5)
- {
- break;
- }
- // WRITE STATEMENTS HERE TO PERFORM ALL NEEDED COMPUTATIONS
- // AND ASSIGN THE RESULTS TO VARIABLES.
- // WRITE STATEMENTS HERE TO DISPLAY THE REQUESTED INFORMATION.
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement