subject
Engineering, 15.10.2019 22:20 juliashalnev

Write a method ismultiple that determines, for a pair of integers, whether the second integer is a multiple of the first. the method should take two integer arguments and return true if the second is a multiple of the first and false otherwise. [hint: use the remainder operator .] incorporate this method into an application that inputs a series of pairs of integers (one pair at a time) and determines whether the second value in each pair is a multiple of the first. har()

prompts:

enter a second number:

enter one number:

sample outputs :

enter one number: enter a second number: 49 is a multiple of 7

do you want to enter another pair(y/n)? enter one number: enter a second number: 28 is a multiple of 7

do you want to enter another pair(y/n)? enter one number: enter a second number: 42 is a multiple of 7

do you want to enter another pair(y/n)? enter one number: enter a second number: 7 is not a multiple of 42

do you want to enter another pair(y/n)? enter one number: enter a second number: 25 is a multiple of -5

do you want to enter another pair(y/n)? enter one number: enter a second number: 12 is a multiple of -12

do you want to enter another pair(y/n)? enter one number: enter a second number: 9 is not a multiple of 56

do you want to enter another pair(y/n)?

ansver
Answers: 2

Another question on Engineering

question
Engineering, 04.07.2019 18:10
The thermal expansion or contraction of a given metal is a function of the f a)-density b)-initial temperature c)- temperature difference d)- linear coefficient of thermal expansion e)- final temperature f)- original length
Answers: 2
question
Engineering, 04.07.2019 19:10
Starting wih an energy balance on a rectangular volume element, derive the one- dimensional transient heat conduction equation for a plane wall with constant thermal conductivity and no heat generation.
Answers: 1
question
Engineering, 04.07.2019 19:10
Agas contained within a piston-cylinder assembly e end nation about same energy states, 1 and 2, where pi 10 bar, v undergoes two processes, a and b, between the sam 0.1 m3, ui-400 kj and p2 1 bar, v2 1.0 m2, u2 200 kj: process a: process from 1 to 2 during which the pressure- volume relation is pv constant process b: constant-volume process from state 1 to a pressure of 2 bar, followed by a linear pressure-volume process to +20 0 state 2 kinetic and potential energy effects can be ignored. for each of the processes a and b, (a) sketch the process on p-v coordinates, (b) evaluate the work, in kj, and (c) evaluate process the heat transfer, in kj
Answers: 2
question
Engineering, 04.07.2019 19:20
Liquid flows at steady state at a rate of 2 lb/'s through a pump, which operates to raise the elevation of the liquid 100 ft from control volume inlet to exit. the liquid specific enthalpy at the inlet is 40.09 btu/lb and at the exit is 40.94 btub. the pump requires 3 btu/s of power to operate. if kinetic energy effects are negligible and gravitational acceleration is 32.174 tt/s, the heat transfer rate associated with this steady state process is most closely 1)-2,02 btu/s from the liquid to the surroundings 2)-3.98 btu/s from the surroundings to the liquid. 3)-4.96 btu/s from the surroundings to the liquid. 4)-1.04 btu/s from the liquid to the surroundings.
Answers: 2
You know the right answer?
Write a method ismultiple that determines, for a pair of integers, whether the second integer is a m...
Questions
question
Mathematics, 12.10.2019 19:30
question
English, 12.10.2019 19:30
Questions on the website: 13722367