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
Prefix version of 6600 volts​
GenaCL600 [577]

Answer:

6.6 kilo volts = 6.6 k volts

Explanation:

A prefix is a word, number or a letter that is added before another word. In physics we have different prefixes for the exponential powers of 10, that are placed before units in place of those powers. Some examples are:

deci (d)   ------  10⁻¹

centi (c)   ------  10⁻²

milli (m)   ------   10⁻³

kilo (k)     ------   10³

mega (M) -----   10⁶

giga (G)   ------   10⁹

We have:

6600 volts

converting to exponential form:

=> 6.6 x 10³ volts

Thus, we know that the prefix of kilo (k) is used for 10³.

Hence,

=> <u>6.6 kilo volts = 6.6 k volts</u>

7 0
3 years ago
A medium-sized jet has a 3.8-mm-diameter fuselage and a loaded mass of 85,000 kg. The drag on an airplane is primarily due to th
SCORPION-xisa [38]

Answer:

F_{thrust} ≅ 111 KN

Explanation:

Given that;

A medium-sized jet has a 3.8-mm-diameter i.e diameter (d) = 3.8

mass = 85,000 kg

drag co-efficient (C) = 0.37

(velocity (v)= 230 m/s

density (ρ) = 1.0 kg/m³

To calculate the thrust; we need to determine the relation of the drag force; which is given as:

F_{drag} = \frac{1}{2} × CρAv²

where;

ρ = density of air wind.

C = drag co-efficient

A = Area of the jet

v = velocity of the jet

From the question, we can deduce that the jet is in motion with a constant speed; as such: the net force acting on the jet in the air = 0

SO, F_{drag}-F_{thrust} = 0

We can as well say:

F_{drag}= F_{thrust}

We can now replace F_{thrust} with F_{drag} in the above equation.

Therefore, F_{thrust} = \frac{1}{2} × CρAv²

The A which stands as the area of the jet is given by the formula:

A=\frac{\pi d^2}{4}

We can now have a new equation after substituting our A into the previous equation as:

F_{thrust} = \frac{1}{2} × Cρ (\frac{\pi d^2}{4})v^2

Substituting our data from above; we have:

F_{thrust} = \frac{1}{2} × (0.37)(1.0kg/m^3)(\frac{\pi(3.8m)^2 }{4})(230m/s)^2

F_{thrust} = \frac{1}{8}   (0.37)(1.0kg/m^3)({\pi(3.8m)^2 })(230m/s)^2

F_{thrust} = 110,990N

F_{thrust}  in N (newton) to KN (kilo-newton) will be:

F_{thrust} = (110,990N)*\frac{1KN}{1,000N}

F_{thrust} = 110.990 KN

F_{thrust} ≅ 111 KN

In conclusion, the jet engine needed to provide 111 KN thrust in order to cruise at 230 m/s at an altitude where the air density is 1.0 kg/m³.

5 0
3 years ago
The capacity of a battery is 1800 mAh and its OCV is 3.9 V. a) Two batteries are placed in series. What is the combined battery
Lynna [10]

Answer:

capacity  = 0.555 mAh

capacity  = 3600 mAh

Explanation:

given data

battery = 1800 mAh

OCV = 3.9 V

solution

we get here capacity when it is in series

so here Q = 2C  

capacity  = 2 × ampere × second   ...............1

put here value and we get

and 1 Ah = 3600 C

capacity  = \frac{2}{3600}

capacity  = 0.555 mAh

and

when it is in parallel than capacity will be

capacity = Q1 +Q2   ...............2

capacity  = 1800 + 1800

capacity  = 3600 mAh

3 0
3 years ago
What engineers call moment, scientists call
Svet_ta [14]

Answer:

yes

Explanation:

7 0
2 years ago
You are given a body with no body forces and told that the stress state is given as: ⎡ ⎣ 3αx 5βx2 + αy γz3 5βx2 + αy βx2 0 γz3 0
Lady bird [3.3K]

Answer:

This doesn't represent an equilibrium state of stress

Explanation:

∝ = 1 , β = 1 ,  y = 1

x = 0 , y = 0 , z = 0 ( body forces given as 0 )

Attached is the detailed solution is and also the conditions for equilibrium

for a stress state to be equilibrium all three conditions has to meet the equilibrum condition as explained in the attached solution

5 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
  • Determine if the following errors are systematic or random. Justify your response. (a) Effect of temperature on the circuitry of
    9·1 answer
  • Can i use two shunts and one meter
    11·2 answers
  • You have just finished your OST takeoffs for a single-story home and found 175 LF of interior walls with 2x6 studs 14" OC. The h
    14·1 answer
  • Harmony in music is characterized by _____.
    14·2 answers
  • Carnot heat engine A operates between 20ºC and 520ºC. Carnot heat engine B operates between 20ºC and 820ºC. Which Carnot heat en
    5·1 answer
  • When trying to solve a frame problem it will typically be necessary to draw many free body diagrams. a)-True b)-False
    6·1 answer
  • Parallel circuits???
    9·1 answer
  • Please help me:<br> Use the Node analysis to find the power of all resistors
    9·1 answer
  • During welding in the vertical position, the torch angle can be varied to control sagging.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!