1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Tom [10]
3 years ago
10

Create a program to deteate a program to determine whether a user-specified altitude [meters] is in the troposphere, lower strat

osphere, or upper stratosphere. The program should include a check to ensure that the user entered a positive value less than 50,000. If a nonpositive value or a value of 50,000 or greater is entered, the program should inform the user of the error and terminate. If a positive value
Computers and Technology
1 answer:
nordsb [41]3 years ago
3 0

Answer:

#include <iostream>

using namespace std;

int main()

{

   float altitude;

   cout<<"Enter alttitude in meter";

cin >>altitude;

if(altitude<0 || altitude > 50000)

{

   cout<<"Invalid value entered";

   return 0;

}

else{

   if(altitude<= 10000)

   {cout <<"In troposphere "<<endl;}

   

   else if(altitude>10000 && altitude<=30000)

   {cout <<"In lower stratosphere"<<endl;}

   

   else if(altitude>30000 && altitude<=50000)

   {cout <<"In upper stratosphere"<<endl;}

   

}

   return 0;

}

Explanation:

Define a float type variable. Ask user to enter altitude in meters. Store value to altitude variable.

Now check if value entered is positive and less than 5000,if its not in the range of 0-50,000 display a termination message and exit else check if it's in less than 10000, in between 10000 and 30000 or in between 30000 and 50000.

10,000 is above sea level is troposphere.

10,000-30,000 is lower stratosphere.

30,000-50,000 is upper stratosphere.

You might be interested in
Calculate the performance of a processor taking into account stalls due to data cache and instruction cache misses. The data cac
zhuklara [117]

Answer:

- Calculate the additional CPI due to the icache stalls.

- Calculate the additional CPI due to the dcache stalls.  

- Calculate the overall CPI for the machine.

The additional CPI due to icache stalls = Hit Rate * Hit Latency + Miss Rate*  

Miss Penalty = 0.9*2 + 0.1*50 = 1.8 + 5 = 6.8  

The additional CPI due to dcache stalls = 0.92*2 + 0.08*124 = 11.76  

The overall CPI = 0.3*11.76 + 0.7*1.0 + 1.0*6.8 = 11.03 7.  

Explanation:

6 0
3 years ago
What does hdtv stand for
Gnesinka [82]
High Definition Television
8 0
3 years ago
Read 2 more answers
What is the best resource to learn python?
7nadin3 [17]

Answer:

prolly a snake expert

Explanation:

they know snakes

4 0
2 years ago
Read 2 more answers
Special keys that allow you to use the computer to perform specific functions
Pavel [41]

Answer:

Examples are Ctrl, Alt, Fn, Alt Gr, Shift, Caps Lock, Tab, Scroll Lock, Num lock, Esc, Windows Key, Backspace, Enter...

8 0
3 years ago
Matt expects to get his first paycheck today. What deductions may be listed on his paycheck stub?
Bingel [31]
Social security
Also if he has any taxs they will be deducted
4 0
3 years ago
Other questions:
  • A computer application such as Microsoft Access that is used to store data and convert it into information is a ________________
    6·1 answer
  • Forms are used to a provide a more user-friendly way to work with data in tables
    14·1 answer
  • economists measure the personal satisfaction someone gets from consuming goods and services with the concept of.....?
    6·1 answer
  • How are IP addresses usually written?
    7·1 answer
  • Explain any 10uses of computer that are specific to your field of study giving appropriate examples​
    13·1 answer
  • Nathaniel wanted to buy a microphone. He went to an electronics store and was told that there are actually two types of micropho
    13·2 answers
  • If you said the bottom margin, you are talking about what?
    13·2 answers
  • Describe all the steps a router goes through while deciding where to send the a packet. Explain why a router would choose one ro
    7·1 answer
  • Help help help help help help help help
    12·1 answer
  • Michelle has defined a custom object by creating an object literal. She wants to access the properties of the custom object. Mic
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!