fork download
  1. //Ryan Shahriyarpour CS1A Carl Argila CH2 HW Q:2
  2. //
  3. /*****************************************************************************
  4.  *
  5.  * Computing the East Coast Sales
  6.  *
  7.  *
  8.  * *******
  9.  * The goal of the program is to compute the east coast sales based on
  10.  * 62 percent of total sales which is $4.6 million
  11.  *
  12.  *
  13.  * to find this, the program will use:
  14.  * eastCoastSales = totalSales * percentage
  15.  *
  16.  *
  17.  * *******
  18.  *
  19.  * INPUT
  20.  * total sales : $4.6 million
  21.  * sales percentage : 62 percent
  22.  *
  23.  * OUTPUT
  24.  * east coast sales : east coast
  25.  *
  26.  *****************************************************************************/
  27.  
  28. #include <iostream>
  29.  
  30. int main() {
  31. // Specify the numbers and assign them variables
  32. double totalSales = 4600000;
  33. double percentage = 0.62;
  34.  
  35. // compute the sales and store it in a variable
  36. double eastCoastSales = totalSales * percentage;
  37.  
  38. // compute the final output and show it
  39. std::cout << "The east coast sales end up being $" << eastCoastSales << std::endl;
  40.  
  41. return 0;
  42. }
Success #stdin #stdout 0s 5268KB
stdin
Standard input is empty
stdout
The east coast sales end up being $2.852e+06