Simple Expressions 4

Description

Using basic expressions, display values of different data types

Requirements

  1. Declare an int called days. Initialize this variable to the number of days in a year, 365
  2. Declare an int called minutes. Initialize this variable to 60
  3. Declare an int called hours. Initialize this variable to 24
  4. Declare a string called message. Initialize this variable to a literal string, “Number of minutes”
  5. Declare a double called actual_days. Initialize this variable to 365.2422. 
  6. Declare an int called total. Set this variable to the total number of minutes in a year using the variables you declared in steps 1-3. You will have to write an arithmetic expression to perform the calculation
  7. Display a message showing the value of total along with message (see sample interaction below)
  8. Display a message showing the value of minutes in a tropical year by performing the calculation inline in a cout statement. To calculate the number of minutes in a tropical year, use the actual_days variable instead of days. See below:
    cout << "Number of minutes in a tropical year: " << (write the calculation formula here) << endl;
    
  9. Make sure to use the variables in the display of your output. Do not simply hard-code all the results as numbers or string literals

DO NOT USE

You may not use any conditional constructs such as the IF statement

Sample Interaction / Output

Number of minutes: 525600
Number of minutes in a tropical year: 525949

CATALOG ID: CPP-EXP0004

Print Requirements