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>
- #include <iomanip>
- using namespace std;
- int main()
- {
- // DEFINE NAMED CONSTANTS HERE TO HOLD THE PRICES OF THE 3
- double x = 1.49; // price of a single scoop
- double y = 2.49; // price of a doublescoop
- double 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 = 0;
- int twoscoop = 0;
- int threescoop = 0;
- int choice = 1;
- // 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\n\nyour choice: ";
- 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" << right << setw(10) << "Total Sales\n";
- cout << "=================================\n";
- cout << left << setw(30) << "Delightful cones" << right << setw(4) << onescoop << setw(10) << x * onescoop << "\n";
- cout << left << setw(30) << "Double Delight cones" << right << setw(4) << twoscoop << setw(10) << y * twoscoop << "\n";
- cout << left << setw(30) << "Triple Deleight conse" << right << setw(4) << threescoop << setw(10) << z * threescoop << "\n";
- cout << left << setw(30) << "Total" << right << setw(4) << onescoop + twoscoop + threescoop << setw(10) << (x * onescoop) + (y * twoscoop) + (z * threescoop) << "\n\n\n";
- }
- else if (choice == 5)
- {
- break;
- }
- else
- {
- cout << "USE CORRECT INPUTS!\n\n\n";
- }
- }
- // 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