subject
Engineering, 19.12.2019 00:31 Oso29

This program reads in two numbers from the user, dividend and divisor, and prints out whether dividend is evenly divisible by divisor. for example, one run of the program may look like this: enter the dividend: 10 enter the divisor: 5 10 is divisible by 5! because 5 goes into 10 twice. 10 is evenly divisible by 5. another run may look like this: enter the dividend: 10 enter the divisor: 8 10 is not divisible by 8! because 10 / 8 is 1.25, 10 is not evenly divisible by 8. the bug: the problem is that if the user inputs 0 for the divisor, the program tries to divide by 0 and the program crashes. your job: your job is to use short circuiting to prevent the condition inside the if statement from dividing by 0. your program should be able to produce the following output: enter the dividend: 10 enter the divisor: 0 10 is not divisible by 0!

ansver
Answers: 1

Another question on Engineering

question
Engineering, 04.07.2019 18:10
Air is to be cooled in the evaporator section of a refrigerator by passing it over a bank of 0.8-cm-outer-diameter and 0.4-m-long tubes inside which the refrigerant is evaporating at -20°c. air approaches the tube bank in the normal direction at 0°c and 1 atm with a mean velocity of 4 m/s. the tubes are arranged in-line with longitudinal and transverse pitches of sl- st 1.5 cm. there are 30 rows in the flow direction with 15 tubes in each row. determine (a) the refrigeration capacity of this system and (b) pressure drop across the tube bank. evaluate the air properties at an assumed mean temperature of -5°c and 1 atm. is this a good assumption?
Answers: 1
question
Engineering, 04.07.2019 18:10
Adouble-strand no. 60 roller chain is used to transmit power between a 13-tooth driving sprocket rotating at 300 rev/min and a 52-tooth driven sprocket. a) what is the allowable horsepower of this drive? b) estimate the center-to-center distance if the chain length is 82 pitches. c) estimate the torque and bending force on the driving shaft by the chain if the actual horsepower transmitted is 30 percent less than the corrected (allowable) power.
Answers: 3
question
Engineering, 04.07.2019 18:20
Aquick transition of the operating speed of a shaft from its critical speed will whirl amplitude. (a) increase (b) limit (c) not affect (d) zero
Answers: 2
question
Engineering, 04.07.2019 19:10
In general, how do thermosetting plastics compare to thermoplastics in mechanical and physical properties?
Answers: 3
You know the right answer?
This program reads in two numbers from the user, dividend and divisor, and prints out whether divide...
Questions
Questions on the website: 13722367