Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed
image text in transcribed
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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Moving Objects Databases

Authors: Ralf Hartmut Güting, Markus Schneider

1st Edition

0120887991, 978-0120887996

More Books

Students also viewed these Databases questions