subject
Engineering, 02.11.2019 03:31 bks53

(sum the digits in an integer) write a method that computes the sum of the digits in an integer. use the following method header: public static int sumdigits(long n) for example, sumdigits(234) returns 9 (2 + 3 + 4). (hint: use the % operator to extract digits, and the / operator to remove the extracted digit. for instance, to extract 4 from 234, use 234 % 10 (= 4). to remove 4 from 234, use 234 / 10 (= 23). use a loop to repeatedly extract and remove the digit until all the digits are extracted. write a test program that prompts the user to enter an integer and displays the sum of all its digits.

ansver
Answers: 2

Another question on Engineering

question
Engineering, 03.07.2019 15:10
Heat is added to a piston-cylinder device filled with 2 kg of air to raise its temperature 400 c from an initial temperature of t1 27 cand pressure of pi 1 mpa. the process is isobaric process. find a)-the final pressure p2 b)-the heat transfer to the air.
Answers: 1
question
Engineering, 04.07.2019 18:10
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
question
Engineering, 04.07.2019 18:10
For the closed feedwater heater below, feedwater enters state 3 at a pressure of 2000 psia and temperature of 420 °f at a rate of ix10 ibhr. the feedwat extracted steam enters state 1 at a pressure of 1000 psia and enthalpy of 1500 btu/lbm. the extracted er leaves at an enthalpy of 528.7 btu/lbm steam leaves as a saturated liquid. (16) a) determine the mass flow rate of the extraction steam used to heat the feedwater (10) b) determine the terminal temperature difference of the closed feedwater heater
Answers: 3
question
Engineering, 04.07.2019 18:10
Manometers are good examples of measuring instruments, nowadays they are not as common as before. a)-capacitive probe gauges b)-gravitational gauges deformation ) gauges d)-digital gauges
Answers: 1
You know the right answer?
(sum the digits in an integer) write a method that computes the sum of the digits in an integer. use...
Questions
question
Physics, 17.10.2021 14:00
question
Mathematics, 17.10.2021 14:00
question
History, 17.10.2021 14:00
question
Mathematics, 17.10.2021 14:00
question
English, 17.10.2021 14:00
Questions on the website: 13722363