Question: Exercise #1: cities and average temperatures Write a C++ program that prompts the user to enter the city name and its morning and night temperatures

Exercise #1: cities and average temperatures Write a C++ program that prompts the user to enter the city name and its morning and night temperatures for two cities. The program then outputs each city name and its average temperature in a separate line. Use a tab escape sequence to separate the city name from its average. Enter nane, morning temperature and night tenperature of the first city: Sharjah 37' 34 Enter nane, morning temperature and night temperature of the second city: Dubai 39 36 The city names and average temperatures are: Sharjah 35.5 Dubai 37.5 Process returned 0 (0x0> execution tine : 17.329 S Press any key to continue. IT Exercise #2: use predefined function sqrt(), pow() Write a program that defines the named constant Pl, which stores the value of Tr. The program should use Pl and the predefined functions to accomplish the following: 1. Output the value of Vit 2. Prompt the user to input the value of a double variable r, which stores the radius of a sphere. The program then outputs the following: a. The value of 41tr2, which is the surface area of the sphere. b. The value of (4/3)mer 3 which is the volume of the sphere. E Select C:\Users\10918\Desktop\lab3\Lab3Exl.exe Enter the value of r: 3.5 The value of square root of pi is:1.772 The surface area of the sphere is: 153.86 The volume of the sphere is: 134.627 process returned 0 (exe) execution time : 5.429 $ Press any key to continue
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
