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

Other questions on the subject: Engineering

image
Engineering, 04.07.2019 18:10, yasminothman02
An air conditioning system consist of a 5 cm diameter pipe, operating at a pressure of 200 kpa. the air initially enters the pipe at 15°c with a velocity of 20 m/s and relative humidity of 80%. if the heat supply throughout the process is 960 w, determine the relative humidity and the temperature at the outlet
Answers: 3
image
Engineering, 04.07.2019 18:10, skpdancer1605
Ariver flows from north to south at 8 km/h. a boat is to cross this river from west to east at a speed of 20 km/h (speed of the boat with respect to the earth/ground). at what angle (in degrees) must the boat be pointed upstream such that it will proceed directly across the river (hint: find the speed of the boat with respect to water/river)? a 288 b. 21.8 c. 326 d. 30.2
Answers: 3
image
Engineering, 04.07.2019 18:10, juansoto227711
Journeyman training is usually related (clo2) a)-to specific tasks b)-to cost analysis of maintenance task c)-to control process to ensure quality d)-to installation of machinery
Answers: 2
image
Engineering, 04.07.2019 18:20, sarah7984
Vibration monitoring this technique uses the noise or vibration created by mechanical equipment and in seme cases by plant systems to detemine their actual condtion. a)- true b)- false
Answers: 2
You know the right answer?
This program reads in two numbers from the user, dividend and divisor, and prints out whether divide...

Questions in other subjects:

Konu
History, 22.03.2021 17:20