Advertisement
Limited_Ice

line 51

Sep 16th, 2019
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 2.30 KB | None | 0 0
  1. // Lab 3 icecream.cpp
  2. // This progrma generates an ice cream sales report
  3. // David Hawkins
  4. // INCLUDE ANY NEEDED FILES HERE.
  5. #include <iostream>
  6. #include <string>
  7. using namespace std;
  8. int main()
  9. {
  10.     // DEFINE NAMED CONSTANTS HERE TO HOLD THE PRICES OF THE 3
  11.     float x = 1.49; //  price of a single scoop
  12.     float y = 2.49; //  price of a doublescoop
  13.     float z = 3.49; //  price of a triple scoop
  14.  
  15.     // SIZES OF ICE CREAM CONES. GIVE EACH ONE A DESCRIPTIVE
  16.     // NAME AND AN APPROPRIATE DATA TYPE.
  17.     int onescoop;
  18.     int twoscoop;
  19.     int threescoop;
  20.     int choice;
  21.     // DECLARE ALL NEEDED VARIABLES HERE. GIVE EACH ONE A DESCRIPTIVE
  22.     // NAME AND AN APPROPRIATE DATA TYPE.
  23.     // WRITE STATEMENTS HERE TO PROMPT FOR AND INPUT THE INFORMATION
  24.     // THE PROGRAM NEEDS TO GET FROM THE USER.
  25.     while (true)
  26.     {
  27.         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";
  28.         cin >> choice;
  29.  
  30.         if (choice == 1)
  31.         {
  32.             cout << "How many single scoop cones did you sell?  ";
  33.             cin >> onescoop;
  34.         }
  35.  
  36.         else if (choice == 2)
  37.         {
  38.             cout << "How many double scoop cones did you sell?  ";
  39.             cin >> twoscoop;
  40.         }
  41.  
  42.         else if (choice == 3)
  43.         {
  44.             cout << "How many triple scoop cones did you sell?  ";
  45.             cin >> threescoop;
  46.         }
  47.  
  48.         else if (choice == 4)
  49.         {
  50.             cout << "           Ice Cream Sales Report           \n";
  51.             cout << left << setw(28) << "Type of Cone" << right << setw(6) << "quant" << setw(10) << "Total Sales";
  52.             cout << "=================================";
  53.             cout << left << setw(30) << "Delightful cones" << right << setw(4) << onescoop << setw(10) << x * onescoop;
  54.             cout << left << setw(30) << "Double Delight cones" << right << setw(4) << twoscoop << setw(10) << y * twoscoop;
  55.             cout << left << setw(30) << "Triple Deleight conse" << right << setw(4) << threescoop << setw(10) << z * threescoop;
  56.             cout << ; left << setw(30) << "Total" << right << setw(4) << onescoop + twoscoop + threescoop << setw(10) << (x * onescoop) + (y * twoscoop) + (z * threescoop);
  57.             cout << endl;
  58.         }
  59.  
  60.         else if (choice == 5)
  61.         {
  62.             break;
  63.         }
  64.  
  65.         // WRITE STATEMENTS HERE TO PERFORM ALL NEEDED COMPUTATIONS  
  66.         // AND ASSIGN THE RESULTS TO VARIABLES.
  67.  
  68.         // WRITE STATEMENTS HERE TO DISPLAY THE REQUESTED INFORMATION.
  69.  
  70.         return 0;
  71.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement