Description
Using basic expressions, display values of different data types
Requirements
- Declare a string called name. Initialize this variable to “Kobe Bryant”. This will all be on one line.
- Declare a string called team. Initialize this variable to “Lakers”
- Declare a string called city.
- Assign the value “Los Angeles” to city. This will be on a line by itself.
- Declare an int called twos. Initialize this variable to 9892 (this is how many two-pointers Kobe made)
- Declare an int called threes. Initialize this variable to 1827 (this is how many three-pointers Kobe made)
- Declare an int called frees. Initialize this variable to 8378 (this is how many free throws Kobe made)
- Declare a double called total
- Calculate Kobe’s total accumulated points he shot in his career. Store this value in total
- See the sample interaction / output below. Write the code necessary to display this output.
- To calculate his average points-per-shot, perform the calculation directly in the cout statement.
- Make sure to use the variables as described above in the display of your output. Do not simply hard-code all the results as string literals
DO NOT USE
You may not use any conditional constructs such as the IF statement
Sample Interaction / Output
Kobe Bryant Played for Los Angeles Lakers He scored 33643 points He averaged 1.674 points per shot R.I.P Black Mamba
CATALOG ID: CPP-EXP0002b
Print Requirements