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
yawa3891 [41]
3 years ago
12

Write a do-while loop that continues to prompt a user to enter a number less than 100, until the entered number is actually less

than 100. End each prompt with a newline. Ex: For the user input 123, 395, 25, the expected output is:
Enter a number (<100):
Enter a number (<100):
Enter a number (<100):
Your number < 100 is: 25
c++

#include
using namespace std;

int main() {
int userInput = 0;

do
cout << "Your number < 100 is: " << userInput << endl;

return 0;
}
Engineering
1 answer:
chubhunter [2.5K]3 years ago
8 0

Answer:

#include <iostream>//including iostream library to use functions such as cout and cin

using namespace std;

int main() {

int userInput = 0;

do

{

 cout << "Enter a number < 100: " ;

 cin >> userInput;

 if (userInput < 100)//condition if number is less than 100

 {

  cout << "Your number < 100 is: " << userInput << endl;

 }

} while (userInput > 100);//do while loop condition

return 0;

}

Explanation:

A do-while loop executes regardless in the first iteration. Once it has run through the first iteration, it checks if the condition is being met. If, the condition is TRUE, the loop begins the second iteration. If FALSE, the loop exits. In this case, the condition is the userInput. after the first iteration, lets say the userInput is 120, the condition userInput > 100 is true.Therefore, the loop will run again until eventually the number is less than hundred, lets say 25. In that case the condition would be 25 > 100, which would be false, so the loops will break.

You might be interested in
A man weighs 145 lb on earth.Part ASpecify his mass in slugs.Express your answer to three significant figures and include the ap
adell [148]

Answer:

<em>a) 4.51 lbf-s^2/ft</em>

<em>b) 65.8 kg</em>

<em>c) 645 N</em>

<em>d) 23.8 lb</em>

<em>e) 65.8 kg</em>

<em></em>

Explanation:

Weight of the man on Earth = 145 lb

a) Mass in slug is...

32.174 pound = 1 slug

145 pound = x slug

x = 145/32.174 = <em>4.51 lbf-s^2/ft</em>

b) Mass in kg is...

2.205 pounds = 1 kg

145 pounds = x kg

x = 145/2.205 = <em>65.8 kg</em>

c) Weight in Newton = mg

where

m is mass in kg

g is acceleration due to gravity on Earth = 9.81 m/s^2

Weight in Newton = 65.8 x 9.81 = <em>645 N</em>

d) If on the moon with acceleration due to gravity of 5.30 ft/s^2,

1 m/s^2 = 3.2808 ft/s^2

x m/s^2 = 5.30 ft/s^2

x = 5.30/3.2808 = 1.6155 m/s^2

weight in Newton = mg = 65.8 x 1.6155 = 106

weight in pounds = 106/4.448 = <em>23.8 lb</em>

e) The mass of the man does not change on the moon. It will therefore have the same value as his mass here on Earth

mass on the moon = <em>65.8 kg</em>

3 0
3 years ago
Joinn my zo om lets play some blookets<br> 98867 708157<br> 9dPQPW
pav-90 [236]

Answer:k

Explanation:

6 0
2 years ago
When converting liquid level units to sensor output signal units, you should first convert the liquid level units to _____ units
dangina [55]
The answer is 2 because I just took the test!
7 0
2 years ago
What effect does air have on the acceleration of aircraft during flight?
scoundrel [369]
The effect would be the altitude of the air, the higher you go up the closer you are to space we’re there’s no oxygen and everything moves slow so when your trying to fly across the world it could feel like your moving slower
5 0
3 years ago
How to make text take shape of object in affinity designer
Alina [70]

Answer:

To fit text to a shape in Affinity Designer, make sure you have your text selected. Then, grab the Frame Text Tool and click on the shape. A blinking cursor will appear within the shape, indicating that you can begin typing. The text you type will be confined to the boundaries of the shape.

Explanation:

6 0
3 years ago
Other questions:
  • You have designed a treatment system for contaminant Z. The treatment system consists of a pipe that feeds into a CSTR. The pipe
    8·1 answer
  • A 600-MW steam power plant, which is cooled by a nearby river, has a thermal efficiency of 40 percent. Determine the rate of hea
    10·2 answers
  • An engineer is considering time of convergence in a new Layer 3 environment design. Which two attributes must be considered? (Ch
    15·1 answer
  • Different types of steels contain different elements that alter the characteristics of the steel. For each of the following elem
    6·1 answer
  • The shaft is hollow from A to B and solid from B to C. The shaft has an outer diameter of 79 mm, and the thickness of the wall o
    6·1 answer
  • The air standard efficiency ofan Otto cycle compared to diesel cycle for thie given compression ratio is: (a) same (b) less (c)
    12·1 answer
  • A typical aircraft fuselage structure would be capable of carrying torsion moment. a)True b)- False
    12·1 answer
  • What is the most likely reason the rover won't travel in a straight line?
    9·1 answer
  • Guess the output of this code: print( (3**2)//2)​
    13·1 answer
  • 2. It is a measuring instrument used to record the amount of
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!