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
NAND is logically complete. Use only NAND gates to constructgate-level circuits that compute the
Drupady [299]

Answer:

Hi, for this exercise we have two laws to bear in mind:

Morgan's laws

NOT(А).NOT(В) = NOT(A) + NOT (B)

NOT(A) + NOT (B) = NOT(А).NOT(В)

And the table of the Nand

INPUT OUTPUT

A B A NAND B

0 0         1

0 1         1

1 0         1

1 1         0

Let's start!

a.

Input            OUTPUT

A       A     A NAND A

1         1             0

0        0            1

b.

Input            OUTPUT

A       B     (A NAND B ) NAND (A NAND B )

0         0            0

0         1            0

1          0             0

1          1             1

C.

Input            OUTPUT

A       B     (A NAND A ) NAND (B NAND B )

0        0           0

0        1             1

1         0            1

1          1            1

Explanation:

In the first one, we only need one input in this case A and comparing with the truth table we have the not gate

In the second case, we have to negate the AND an as we know how to build a not, we only have to make a nand in the two inputs (A, B) and the make another nand with that output.

In the third case we have that the OR is A + B and we know in base of the morgan's law that:

A + B = NOT(NOT(А).NOT(В))

So, we have to negate the two inputs and after make nand with the two inputs negated.

I hope it's help you.

3 0
3 years ago
A(n) ________ is a specific type of computer program that manages all programs on a computer.
Oksi-84 [34.3K]
A kernel manages the whole computer including hardware. In Unix, all processes are launched from systemd/launchd.
4 0
3 years ago
Create the code that will find
frez [133]

Answer:

function findLongestWord(str) {

 var longestWord = str.split(' ').sort(function(a, b) { return b.length - a.length; });

 return longestWord[0].length;

}

findLongestWord(InputHere);

Explanation:

Replace InputHere with the input

7 0
3 years ago
Adobe Indesign project 4 museum indesign file. The instructions are 70 pages long I cant sit still long enough to read them
Alchen [17]

Answer:

? Read on to learn about the possible reasons and resolutions. ... Check whether you have the latest update installed for InDesign. ... InDesign cannot open the file when your system does not have enough memory ... Copy page elements into a new document.

Explanation:

4 0
3 years ago
What are the tasks of a doc file
geniusboy [140]

Answer:

computer file is a computer resource for recording data discretely in a computer storage device. Just as words can be written to paper, so can information be written to a computer file. Files can be edited and transferred through the internet on that particular computer system.

6 0
3 years ago
Other questions:
  • String word = “Awesome”;
    9·2 answers
  • Which of the following characteristics relates to authentication header (AH)? It is a document that defines or describes compute
    11·1 answer
  • The ____________ mechanism consists of a lever arm attached to the mousetrap spring.
    15·1 answer
  • A project manager type a document and print it he is using
    14·1 answer
  • The name of a person their address and their contact information like phone number and email address or consider the minimum inf
    9·1 answer
  • Krya needs help deciding which colors she should use on her web page. What can she use to help her decide.
    11·1 answer
  • Website managers use____ every day.
    10·2 answers
  • Write a program to test if an integer input from the keyboard is odd or even. Sample Run 1: Enter a Number: 78 Even Sample Run 2
    7·1 answer
  • Summary about Interface Design in system analysis
    12·1 answer
  • What technology would a bank's website use a scramble information as it is transmitted over the Internet
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!