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
julsineya [31]
3 years ago
11

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:
allsm [11]3 years ago
8 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
Write a function named replace_at_index that takes a string and an integer. The function should return a new string that is the
aalyn [17]

Answer:

def replace_at_index(str, number):

   new = str.replace(str[number], "-")

   return new

print(replace_at_index("eggplant", 3))

Explanation:

- Create a function called <em>replace_at_index</em> that takes a string and an integer

- Initialize a new variable called <em>new</em>, that will hold the new string

- Replace the character at given index with dash using <em>replace</em> function, it takes two parameters: the first is the character we want to replace, the second is the new character.

- Return the new string

- Call the function with the required inputs

4 0
3 years ago
The automotive system that connects the engine and the transmission to the wheels is called the
insens350 [35]
I believe the driveshaft 

8 0
3 years ago
The expression that is tested by a switch statement must have a(n) __________ value.
Hitman42 [59]

The answer is relational.

6 0
3 years ago
True or False: It is illegal to park in a location that you block or create a hazard for other vehicles.
Feliz [49]
The answer to question is true
5 0
3 years ago
Read 2 more answers
Which type of network is created when you use encrypted tunnels between a computer or a remote network and a private network thr
Deffense [45]
<span>Virtual private network (VPN) is the answer</span>
3 0
3 years ago
Other questions:
  • Playville is a tiny town in fictional middle earth, which is inhabited by dwarves and elves. Playville has a playground to which
    6·1 answer
  • According to Mintzberg's classification of managerial roles, the role of a(n) ______ is to transmit information received from ou
    7·1 answer
  • What is the solubility of an empty soda can
    10·1 answer
  • What can a parent do to help a child adjust to a new culture or area
    7·2 answers
  • Which of the following is considered information?
    6·2 answers
  • Microsoft's
    8·1 answer
  • When security issues are a special concern, companies want to take extra steps to make sure that transmissions can’t be intercep
    7·1 answer
  • A(n) ____ investigation tracks all elements of an attack, including how the attack began, what intermediate devices were used du
    5·1 answer
  • What is the difference between the Internet and the World Wide Web? Explain in your own words.
    13·2 answers
  • Who is your favorite person from squid game?
    13·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!