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
Consider uniaxial extension of a test specimen. It has gauge length L = 22 cm (the distance between where it is clamped in the t
Katena32 [7]

Answer:

A) 4800.6 N

B) 0.2255 mm/min

C) 8.6792 inches

Explanation:

Given data :

gauge Length = 22 cm = 220 mm

cross section diameter/thickness = 1.8 mm

young's modulus ( E ) = 205 GPa

Ultimate tensile strength ( σu ) = 420MPa

Time = 2 mins

A) what force would fracture the specimen

σU = Ff /A

where A (area) = thickness * width ( unknown )  hence we assume a width of 6.35 mm

Ff = σU × A =  420 * 1.8 * 6.35 = 4800.6 N

B) calculate the strain rate

Ultimate tensile strength ( σU ) = εE

ε = σU / E = 420/205000 = 0.00205

also  ε ​​​​​​ =  ΔL / Li = ( Lf - Li) / Li = (Lf / Li) - 1

 therefore  ε ​​​​​​ + 1 = (Lf / Li) = 1 + 0.00205 = 1.00205

 Li = gauge length = 220 mm

Hence :  Lf = 1.00205 × gauge length =  1.00205 * 220 =  220.451 mm

  strain rate

(Lf - Li) / Time = (0.451) / 2 min = 0.2255 mm/min

C) Elongation in inches prior to fracture

ΔL = ε × Li = 0.451 mm

Lf = 220 mm + 0.451 mm = 220.451 mm =  8.6792 inches

3 0
3 years ago
You live on a street that runs East to West. You just had 2 inche of snow and you live on the North side of the street. You retu
RSB [31]

Answer:

The heat from the sun melted it

Explanation:

If the street runs east to west, houses on the south (across the street) will project shadows on their sidewalk, while the northern sidewalk will be illuminated. This is for the northern hemisphere, on the southern hemisphere it would be the other way around.

5 0
3 years ago
A venturi meter is to be installed in a 63 mm bore section of a piping system to measure the flow rate of water in it. From spac
Alex Ar [27]

Answer:

Throat diameter d_2=28.60 mm

Explanation:

 Bore diameter d_1=63mm  ⇒A_1=3.09\times 10^{-3} m^2

Manometric deflection x=235 mm

Flow rate Q=240 Lt/min⇒ Q=.004\frac{m^3}{s}

Coefficient of discharge C_d=0.8

We know that discharge through venturi meter

 Q=C_d\dfrac{A_1A_2\sqrt{2gh}}{\sqrt{A_1^2-A_2^2}}

h=x(\dfrac{S_m}{S_w}-1)

S_m=13.6 for Hg and S_w=1 for water.

h=0.235(\dfrac{13.6}{1}-1)

h=2.961 m

Now by putting the all value in

Q=C_d\dfrac{A_1A_2\sqrt{2gh}}{\sqrt{A_1^2-A_2^2}}

0.004=0.8\times \dfrac{3.09\times 10^{-3} A_2\sqrt{2\times 9.81\times 2.961}}{\sqrt{(3.09\times 10^{-3})^2-A_2^2}}

A_2=6.42\times 10^{-4} m^2

 ⇒d_2=28.60 mm

So throat diameter d_2=28.60 mm

     

4 0
3 years ago
Glyphicons is mainly used for​
-Dominant- [34]

Glyphicons are icon fonts which you can use in your web projects. Glyphicons Halflings are not free and require licensing, however their creator has made them available for Bootstrap projects free of cost.

7 0
2 years ago
A water skier leaves the end of an 8 foot tall ski ramp with a speed of 20 mi/hr and at an angle of 250. He lets go of the tow r
klemol [59]

Answer:

At highest point:

y1 = 10.4 ft

v1 = (26.5*i + 0*j) ft/s

When he lands:

x2 = 31.5 ft (distance he travels)

t2 = 1.19 s

V2 = (26.5*i - 25.9*j) ft/s

a2 = -44.3°

Explanation:

Since he let go of the tow rope upon leaving the ramp he is in free fall from that moment on. In free fall he is affected only by the acceleration of gravity. Gravity has a vertical component only, so the movement will be at constant acceleration in the vertical component and at constant speed in the horizontal component.

20 mi / h = 29.3 ft/s

If the ramp has an angle of 25 degrees, the speed is

v0 = (29.3 * cos(25) * i + 29.3 * sin(25) * j) ft/s

v0 = (26.5*i + 12.4*j) ft/s

I set up the coordinate system with the origin at the base of the ramp under its end, so:

R0 = (0*i + 8*j) ft

The equation for the horizontal position is:

X(t) = X0 + Vx0 * t

The equation for horizontal speed is:

Vx(t) = Vx0

The equation for vertical position is:

Y(t) = Y0 + Vy0 * t + 1/2 * a * t^2

The equation for vertical speed is:

Vy(t) = Vy0 + a * t

In this frame of reference a is the acceleration of gravity and its values is -32.2 ft/s^2.

In the heighest point of the trajectory the vertical speed will be zero because that is the point where it transitions form going upwards (positive vertical speed) to going down (negative vertical speed), and it crosses zero.

0 = Vy0 + a * t1

a * t1 = -Vy0

t1 = -Vy0 / a

t1 = -12.4 / -32.2 = 0.38 s

y1 = y(0.38) = 8 + 12.4 * 0.38 + 1/2 * (-32.2) * (0.38)^2 = 10.4 ft

The velocity at that moment will be:

v1 = (26.5*i + 0*j) ft/s

When he lands in the water his height is zero.

0 = 8 + 12.4 * t2 + 1/2 * (-32.2) * t2^2

-16.1 * t2^2 + 12.4 * t2 + 8 = 0

Solving this equation electronically:

t2 = 1.19 s

Replacing this time on the position equation:

X(1.19) = 26.5 * 1.19 = 31.5 ft

The speed is:

Vx2 = 26.5 ft/s

Vy2 = 12.4 - 32.2 * 1.19 = -25.9 ft/s

V2 = (26.5*i - 25.9*j) ft/s

a2 = arctg(-25.9 / 26.5) = -44.3

3 0
3 years ago
Other questions:
  • Show from the first principles that, for a perfect gas with constant specific heat capacities
    14·1 answer
  • How do i get my camera to work in the app, i just got a new phone and it won’t pull up the camera
    14·1 answer
  • Find the sum and product of each of these pairs of numbers. Express your answers as a base 3 expansion. Hint: We can just add an
    5·1 answer
  • 11. Technician A says that gasoline storage containers should be painted red. Technician B says that any metal container may be
    7·1 answer
  • An object at a vertical elevation of 20 m and a speed of 5 m/s decreases in elevation to an elevation of 1 m. At this location,
    15·1 answer
  • What is this i dont understand this at all
    9·1 answer
  • Please help been stuck on this for a couple minutes
    5·1 answer
  • What building codes did Mega Corporation fail to follow?
    9·1 answer
  • What do you think causes the differences in the properties of oxygen gas (O2) and ozone (O3)? the space between the atoms the ra
    9·1 answer
  • Why is personal development necessary based activity success life and career​
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!