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
k0ka [10]
4 years ago
8

declare integer product declare integer number product = 0 do while product < 100 display ""Type your number"" input number p

roduct = number * 10 loop display product End While
Engineering
1 answer:
Brilliant_brown [7]4 years ago
4 0

Full Question

1. Correct the following code and

2. Convert the do while loop the following code to a while loop

declare integer product

declare integer number

product = 0

do while product < 100

display ""Type your number""

input number

product = number * 10

loop

display product

End While

Answer:

1. Code Correction

The errors in the code segment are:

a. The use of do while on line 4

You either use do or while product < 100

b. The use of double "" as open and end quotes for the string literal on line 5

c. The use of "loop" statement on line 7

The correction of the code segment is as follows:

declare integer product

declare integer number

product = 0

while product < 100

display "Type your number"

input number

product = number * 10

display product

End While

2. The same code segment using a do-while statement

declare integer product

declare integer number

product = 0

Do

display "Type your number"

input number

product = number * 10

display product

while product < 100

You might be interested in
The driving force for fluid flow is the pressure difference, and a pump operates by raising the pressure of a fluid (by converti
Lady_Fox [76]

Answer:

The maximum possible volume flow of gasoline is 0.543 m^3/s

Explanation:

Power = pressure differential × volume flow rate

Power = 3.8 kW

Pressure differential = 7 kPa

Volume flow rate = power ÷ pressure differential = 3.8 ÷ 7 = 0.543 m^3/s

3 0
4 years ago
2.) A fluid moves in a steady manner between two sections in a flow
Talja [164]

Answer:

250\ \text{lbm/min}

625\ \text{ft/min}

Explanation:

A_1 = Area of section 1 = 10\ \text{ft}^2

V_1 = Velocity of water at section 1 = 100 ft/min

v_1 = Specific volume at section 1 = 4\ \text{ft}^3/\text{lbm}

\rho = Density of fluid = 0.2\ \text{lb/ft}^3

A_2 = Area of section 2 = 2\ \text{ft}^2

Mass flow rate is given by

m=\rho A_1V_1=\dfrac{A_1V_1}{v_1}\\\Rightarrow m=\dfrac{10\times 100}{4}\\\Rightarrow m=250\ \text{lbm/min}

The mass flow rate through the pipe is 250\ \text{lbm/min}

As the mass flowing through the pipe is conserved we know that the mass flow rate at section 2 will be the same as section 1

m=\rho A_2V_2\\\Rightarrow V_2=\dfrac{m}{\rho A_2}\\\Rightarrow V_2=\dfrac{250}{0.2\times 2}\\\Rightarrow V_2=625\ \text{ft/min}

The speed at section 2 is 625\ \text{ft/min}.

3 0
3 years ago
You recall an algorithm from elementary school for factoring a number N: Divide out all factors of 2, then of 3, then of 4, then
Contact [7]

Answer:

let number = 0

while number < 1

  begin

     print "Enter a positive integer: "

     read number

  end

end_while

find and print number's factors:

let prime = TRUE

let currentFactor = 2

let lastFactor = the square root of number truncated

  to an integer value

while currentFactor <= lastFactor

  begin

     if number is evenly divisible by currentFactor

        begin

           print currentFactor

           let number = number / currentFactor

        end

     else

        let currentFactor = currentFactor + 1

     end_if

  end

end_while

print a message if number is prime:

if prime == TRUE

  print "Your number is prime"

end_if

Explanation:

4 0
3 years ago
The flow of a real fluid has (more —less - same ) complexity of an ideal fluid, owing to the phenomena caused by the existence o
Viefleur [7K]

Answer:

The flow of a real fluid has <u>more</u> complexity as compared to an ideal fluid owing to the phenomena caused by existence of <u>viscosity</u>

Explanation:

For a ideal fluid we know that there is no viscosity of the fluid hence the boundary condition need's not to be satisfied and the flow occur's without any head loss due to viscous nature of the fluid. The friction of the pipe has no effect on the flow of an ideal fluid. But for a real fluid the viscosity of the fluid has a non zero value, the viscosity causes boundary layer effects, causes head loss and also frictional losses due to pipe friction hugely make the analysis of the flow complex. The losses in the energy of the flow becomes complex to calculate as frictional losses depend on the roughness of the pipe and Reynolds number of the flow thus increasing the complexity of the analysis of flow.

3 0
3 years ago
¿Qué es la masonería?​
timofeeve [1]

Answer: freemasonry is Being a Mason is about a father helping his son make better decisions; a business leader striving to bring morality to the workplace; a thoughtful man learning to work through tough issues in his life.

Explanation:

3 0
3 years ago
Other questions:
  • Create a class called Candle to represent a candle. It should have four private instance variables: An int for the height, an in
    6·1 answer
  • _____________ are designed to make it easier for employees to get health and safety information about chemicals.
    9·2 answers
  • Design a half-wave recti er which provides a peak voltage of 15 V, and anaverage voltage of 3.8 V when driven by a 120 V (rms) a
    10·1 answer
  • A solid titanium alloy [G 114 GPa] shaft that is 720 mm long will be subjected to a pure torque of T 155 N m. Determine the mini
    5·1 answer
  • What types of information are provided in the invitation to bid?
    7·1 answer
  • 1. Which of the following is the ideal way to apply pressure onto pedals?
    14·2 answers
  • Tech A says that multiple gasket or seal leaks can be caused by a defective exhaust gas recirculation (EGR) system.
    5·1 answer
  • : A cyclical load of 1500 lb is to be exerted at the end of a 10 in. long aluminium beam (see Figure below). The bar must surviv
    6·1 answer
  • Air enters a constant-area combustion chamber at a pressure of 101 kPa and a temperature of 70°C with a velocity of 130 m/s. By
    8·1 answer
  • What is the design wind speed for average-risk building:_____.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!