fork download
  1. //Julio Ramirez CSC5 Chapter 2, P. 81, #2
  2.  
  3. /*******************************************************************************
  4.  * Sales Prediction
  5.  * _____________________________________________________________________________
  6.  * This program computes the predicted sales (in dollars) for a sales division
  7.  * based on the percentage of the company's total sales that the division
  8.  * generates and the company's expected total sales.
  9.  *
  10.  * Computation is based on the Formula:
  11.  * Sales Prediction for Sales Division = (Company's Expected Total Sales *
  12.  * Percentage of the Company's Total Sales that the Division Generates) / 100
  13.  * _____________________________________________________________________________
  14.  * INPUT
  15.  * salesPercent : Percentage of the company's total sales that
  16.  * the division generates
  17.  * expectedSales : Company's expected total sales
  18.  *
  19.  * OUTPUT
  20.  * predictedSales : Sales prediction for sales division
  21.  *
  22.  ******************************************************************************/
  23. #include <iostream>
  24. using namespace std;
  25.  
  26. int main()
  27. {
  28. float salesPercent; //Input - Percentage of the company's total sales
  29. // that the division generates
  30. float expectedSales; //Input - Company's expected total sales
  31. float predictedSale; //Output - Sales prediction for sales division
  32.  
  33. // Initialize Program Variables
  34. salesPercent = 62;
  35. expectedSales = 4600000;
  36.  
  37. // Compute Predicted Sales
  38. salesPercent = (expectedSales * salesPercent)/100;
  39.  
  40. // Output Results
  41. cout << "The sales divisons predicted sales is: $" << salesPercent;
  42. return 0;
  43. }
  44.  
Success #stdin #stdout 0.01s 5292KB
stdin
Standard input is empty
stdout
The sales divisons predicted sales is: $2.852e+06