Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Using simple if/else statement and switch statement C++ programming. ( Im not quite sure how to type the calculation in this program) Thank you. Down

Using simple if/else statement and switch statement C++ programming. ( Im not quite sure how to type the calculation in this program) Thank you.
image text in transcribed
Down below is my c++ program so far :
#include
using namespace std;
double x, y, z, a, b, windchillcalculation, heatindexcalculation;
int main()
{
int choice;
cout
cout
cout
cin>>choice;
if(choice==1)
{
cout
cin>>z;
cout
cout
cin>>x;
cout
cout
cin>>y;
cout
windchillcalculation=()
}
if(choice==2)
{
cout
cin>>a;
cout
cout
cin>>b;
cout
}
}
The temperature perceived by the human body is a function of ambient air temperature and other factors, including wind speed, humidity, and solar radiation. Perceived temperature can be modeled using simplified formulas as either heat index or wind chill. Create a program to calculate either the heat index or the wind chill, based on the user's choice. Ask the user to make a selection: 1. wind chill (up to 20 degrees Celsius) heat index (20 degrees Celsius and above) 2. For wind chill, prompt the user for: temperature in degrees Celsius wind speed in m/s (at 10m elevation) relative humidity (%) . Formula for wind chill (apparent temperature): AT Ta +0.33xe -0.70xws-4.00 where Ta dry bulb air temperature in degrees Celsius ws wind speed at 10m of elevation e = water vapor pressure, according to the following formula: e- rh/100x 6.105x exp (17.27 x Ta/(237.7+ Ta)) where rhs relative humidity (%) For heat index, prompt the user for: temperature in degrees Celsius relative humidity (%) . Calculate heat index (WBGT) using this formula: WBGT-(0.567 x Ta)+ (0.393 x e)+3.94 where Ta - dry bulb air temperature in degrees Celsius e water vapor pressure, according to the following formula: e (rh/100) x6.105 x exp (17.27 x Ta/(237.7 +Ta )) Celsius to the nearest whole degree. Be sure to use the Report the result in degrees appropriate data types for the variables and constants in your program. Take care to compose user interface that will give the user a comfortable experience

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

Step: 3

blur-text-image

Ace Your Homework with AI

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

Get Started

Students also viewed these Databases questions

Question

Write short notes on Marketing mix.

Answered: 1 week ago

Question

Analyse the process of new product of development.

Answered: 1 week ago

Question

Define Trade Mark.

Answered: 1 week ago

Question

Have ground rules been established for the team?

Answered: 1 week ago

Question

a. How are members selected to join the team?

Answered: 1 week ago

Question

b. Will new members be welcomed?

Answered: 1 week ago