fork download
  1. //Amari Mosley CSC5 Chapter 2, P. 81, #1
  2. //
  3. /**************************************************************
  4.  *
  5.  * SALES PREDICTION
  6.  * ____________________________________________________________
  7.  * This program will predict how much the East Coast division will
  8. generate if the company has $4.6 million in sales this year
  9.  
  10.  * Computation is based on the formula:
  11.  * East Coast Generation = Company sales * East Coast Division Percentage
  12.  * ____________________________________________________________
  13.  * INPUT
  14.  * TotalSales : The Company's Total Sales
  15.  *
  16.  * EastCoast : The East Coast Division's Percentage
  17.  *
  18.  * OUTPUT
  19.  * EastCoastGen : Sum of Integer 1 + Integer 2
  20.  *
  21.  **************************************************************/
  22. #include <iostream>
  23. #include <iomanip>
  24. using namespace std;
  25.  
  26. // Defining Main Function
  27. int main()
  28.  
  29. {
  30. // Defining double Variables
  31. double TotalSales, EastCoast, EastCoastGen;
  32.  
  33. // Assigning Values of Variables TotalSales and EastCoast
  34. TotalSales = 4600000, EastCoast = 0.62;
  35.  
  36. //Computing Product of Values
  37. EastCoastGen = TotalSales * EastCoast;
  38.  
  39. //Final Generation Display
  40. cout << "The East Coast Division will generate " << EastCoastGen << " dollars in sales. ";
  41.  
  42. return 0;
  43. }
Success #stdin #stdout 0s 5320KB
stdin
Standard input is empty
stdout
The East Coast Division will generate 2.852e+06 dollars in sales.