SHARE
TWEET

this was the code,

Limited_Ice Sep 16th, 2019 100 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. #include <iomanip>
  8. using namespace std;
  9. int main()
  10. {
  11.     // DEFINE NAMED CONSTANTS HERE TO HOLD THE PRICES OF THE 3
  12.     double x = 1.49; // price of a single scoop
  13.     double y = 2.49; // price of a doublescoop
  14.     double z = 3.49; // price of a triple scoop
  15.  
  16.     // SIZES OF ICE CREAM CONES. GIVE EACH ONE A DESCRIPTIVE
  17.     // NAME AND AN APPROPRIATE DATA TYPE.
  18.     int onescoop = 0;
  19.     int twoscoop = 0;
  20.     int threescoop = 0;
  21.     int choice = 1;
  22.     // DECLARE ALL NEEDED VARIABLES HERE. GIVE EACH ONE A DESCRIPTIVE
  23.     // NAME AND AN APPROPRIATE DATA TYPE.
  24.     // WRITE STATEMENTS HERE TO PROMPT FOR AND INPUT THE INFORMATION
  25.     // THE PROGRAM NEEDS TO GET FROM THE USER.
  26.     while (true)
  27.     {
  28.         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\n\nyour choice:  ";
  29.         cin >> choice;
  30.  
  31.         if (choice == 1)
  32.         {
  33.             cout << "How many single scoop cones did you sell?  ";
  34.             cin >> onescoop;
  35.         }
  36.  
  37.         else if (choice == 2)
  38.         {
  39.             cout << "How many double scoop cones did you sell?  ";
  40.             cin >> twoscoop;
  41.         }
  42.  
  43.         else if (choice == 3)
  44.         {
  45.             cout << "How many triple scoop cones did you sell?  ";
  46.             cin >> threescoop;
  47.         }
  48.  
  49.         else if (choice == 4)
  50.         {
  51.             cout << "           Ice Cream Sales Report           \n";
  52.             cout << left << setw(28) << "Type of Cone" << right << setw(6) << "quant" << right << setw(10) << "Total Sales\n";
  53.             cout << "=================================\n";
  54.             cout << left << setw(30) << "Delightful cones" << right << setw(4) << onescoop << setw(10) << x * onescoop << "\n";
  55.             cout << left << setw(30) << "Double Delight cones" << right << setw(4) << twoscoop << setw(10) << y * twoscoop << "\n";
  56.             cout << left << setw(30) << "Triple Deleight conse" << right << setw(4) << threescoop << setw(10) << z * threescoop << "\n";
  57.             cout << left << setw(30) << "Total" << right << setw(4) << onescoop + twoscoop + threescoop << setw(10) << (x * onescoop) + (y * twoscoop) + (z * threescoop) << "\n\n\n";
  58.         }
  59.  
  60.         else if (choice == 5)
  61.         {
  62.             break;
  63.         }
  64.         else
  65.         {
  66.             cout << "USE CORRECT INPUTS!\n\n\n";
  67.         }
  68.     }
  69.         // WRITE STATEMENTS HERE TO PERFORM ALL NEEDED COMPUTATIONS  
  70.         // AND ASSIGN THE RESULTS TO VARIABLES.
  71.  
  72.         // WRITE STATEMENTS HERE TO DISPLAY THE REQUESTED INFORMATION.
  73.  
  74.         return 0;
  75. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top