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]
4 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]4 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 cold air standard gas turbine engine with a thermal efficiency of 56.9 % has a minimum pressure of 100 kP
Aleks04 [339]

Answer:

a) 5.2 kPa

b) 49.3%

Explanation:

Given data:

Thermal efficiency ( л ) = 56.9% = 0.569

minimum pressure ( P1 ) = 100 kpa

<u>a) Determine the pressure at inlet to expansion process</u>

P2 = ?

r = 1.4

efficiency = 1 - [ 1 / (rp)\frac{r-1}{r} ]

   0.569   = 1 - [ 1 / (rp)^0.4/1.4

1 - 0.569  = 1 / (rp)^0.285

∴ (rp)^0.285 = 0.431

rp = 0.0522

note : rp = P2 / P1

therefore P2 = rp * P1 = 0.0522 * 100 kpa

                                   = 5.2 kPa  

b) Thermal efficiency

Л = 1 - [ 1 / ( 10.9 )^0.285 ]

   = 0.493 = 49.3%

4 0
3 years ago
An engineer lives in Hawaii at a location where the annual rain fall is 300 inches. She decides to use the rain to generate elec
Alex777 [14]

Answer:

80.7lbft/hr

Explanation:

Flow rate of water in the system = 3.6x10^-6

The height h = 100

1s = 1/3600h

This implies that

Q = 3.6x10^-6/[1/3600]

Q = 0.0000036/0.000278

Q = 0.01295

Then the power is given as

P = rQh

The specific weight of water = 62.3 lb/ft³

P = 62.3 x 0.01295 x 100

P = 80.675lbft/h

When approximated

P = 80.7 lbft/h

This is the average power that could be generated in a year.

This answers the question and also corresponds with the answer in the question.

4 0
3 years ago
You guys are amazing :D
Sloan [31]
Ik i am thank you tho xoxo
3 0
3 years ago
Read 2 more answers
A cylinder with a 6.0 in. diameter and 12.0 in. length is put under a compres-sive load of 150 kips. The modulus of elasticity f
jeka94

Answer:

Final Length = 11.992 in

Final Diameter = 6.001 in

Explanation:

First we calculate the cross-sectional area:

Area = A = πr² = π(3 in)² = 28.3 in²

Now, we calculate the stress:

Stress = Compressive Load/Area

Stress = - 150 kips/28.3 in²

Stress = -5.3 ksi

Now,

Modulus of Elasticity = Stress/Longitudinal Strain

8000 ksi = -5.3 ksi/Longitudinal Strain

Longitudinal Strain = -6.63 x 10⁻⁴

but,

Longitudinal Strain = (Final Length - Initial Length)/Initial Length

-6.63 x 10⁻⁴ = (Final Length - 12 in)/12 in

Final Length = (-6.63 x 10⁻⁴)(12 in) + 12 in

<u>Final Length = 11.992 in</u>

we know that:

Poisson's Ratio = - Lateral Strain/Longitudinal Strain

0.35 = - Lateral Strain/(- 6.63 x 10⁻⁴)

Lateral Strain = (0.35)(6.63 x 10⁻⁴)

Lateral Strain = 2.32 x 10⁻⁴

but,

Lateral Strain = (Final Diameter - Initial Diameter)/Initial Diameter

2.32 x 10⁻⁴ = (Final Diameter - 6 in)/6 in

Final Diameter = (2.32 x 10⁻⁴)(6 in) + 6 in

<u>Final Diameter = 6.001 in</u>

8 0
3 years ago
Who will win the Copa America 2021 and Euros 2021?
Bess [88]
Brazil will win copa America
4 0
3 years ago
Other questions:
  • . Air at 200 C blows over a 50 cm x 75 cm plain carbon steel (AISI 1010) hot plate with a constant surface temperature of 2500 C
    6·1 answer
  • What is the capacity of the machine in batches?
    10·1 answer
  • If you touch a downed power line, covered or bare, what's the likely outcome?
    8·2 answers
  • For what two reasons do countries specialize? Countries specialize so that opportunity costs can be increased. Countries special
    13·1 answer
  • A decorative fountain was built so that water will rise to a hieght of 8 feet above the exit of the pipe. the pipe is 3/4 diamet
    5·1 answer
  • Cold water (cp = 4180 J/kg·K) leading to a shower enters a thin-walled double-pipe counterflow heat exchanger at 15°C at a rate
    11·1 answer
  • What energy type is represented in the picture?
    6·2 answers
  • (100 POINTS) {BRIANLIEST} PLEASE HELP ME
    5·1 answer
  • TWO SENTENCES!!! What is something that you have used today that was designed by an engineer? What parts were designed by an eng
    11·2 answers
  • The main function of a router is to
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!