Description
Using basic expressions, display values of different data types
Requirements
- Declare an int called days. Initialize this variable to the number of days in a year, 365
- Declare an int called minutes. Initialize this variable to 60
- Declare an int called hours. Initialize this variable to 24
- Declare a string called message. Initialize this variable to a literal string, “Number of minutes”
- Declare a double called actual_days. Initialize this variable to 365.2422.
- 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
- Display a message showing the value of total along with message (see sample interaction below)
- 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;
- 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