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
What is a device that connects to the system unit and is controlled by the processor in the computer called !
Airida [17]
Most computers have three types of ports: serial, parallel, and USB. A serial port is a type of interface that connects a device to the system unit by transmitting data only one bit at a time. Serial ports usually connect devices that do not require fast data transmission rates, such as a mouse, keyboard, or modem.
4 0
3 years ago
I need help with this​
Elodia [21]
The answer is number 2.
8 0
3 years ago
Select the risks associated with the Internet.
tino4ka555 [31]
Sharing your personal information and identity theft but if you’re supposed to choose one then sharing your personal information must be right
3 0
2 years ago
A man travel 200m towards east&lt;br /&gt;from his house then takes left&lt;br /&gt;to turn and moves 200 m north&lt;br /&gt;fin
11Alexandr11 [23.1K]
Using the Pythagorean theorem:

200^2 + 200^2 = x^2

x = 282.842712... from the original distance
4 0
3 years ago
Are computer software programs an example of land, labor or capital?
Allisa [31]

Answer:

Labor

Explanation:

3 0
2 years ago
Read 2 more answers
Other questions:
  • What is a risk or an effect of software piracy?
    9·2 answers
  • If you want to copy text formatting from one area of your document to another area, _____.
    5·2 answers
  • Should organizations fear websites where consumers post negative messages about products or services? What actions can companies
    12·1 answer
  • )In a graph represented by adjacency matrix u can find all the neighbours of a given vertices in ____Operations
    6·1 answer
  • How does a programmer use digital waves to transfer sound?
    11·1 answer
  • | HELP PLS! C++ Sorting arrays can be performed using either Selection Sort or Insertion Sort or
    13·1 answer
  • Simple interest will always pay more interest than compound interest.
    14·1 answer
  • Help pweeze this is due today :(<br><br> I will give u brainliest just pweeze, I need this answer :(
    8·1 answer
  • C
    5·1 answer
  • 1- pensamiento sistémico<br>2- visión oriental y occidental​
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!