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, 04.07.2019 18:10
Aturning operation is performed with following conditions: rake angle of 12°, a feed of 0.35 mm/rev, and a depth of cut of 1.1 mm. the work piece is aluminum alloy 6061 with t6 heat treatment (a16061-t6). the resultant chip thickness was measured to be 1.0 mm. estimate the cutting force, fc. use shear stress of 207 mpa and coefficient of friction on the tool face of 0.6.
Answers: 1
question
Engineering, 06.07.2019 03:10
Explain the strain-hardening phenomenon on the basis of dislocation - dislocation strain field interactions. also, briefly describe what generally happens to the ductility of a metal that has been strain hardened (i.e. does strain hardening make a metal more ductile or
Answers: 3
question
Engineering, 06.07.2019 03:10
List and describe the attached tools in boxford cnc milling machine? and how many tools were used in your projects explain them?
Answers: 3
question
Engineering, 06.07.2019 03:10
Consider two concentric spheres forming an enclosure with diameters of 12 cm and 18 cm the spheres are maintained at uniform temperatures ti-50°c and t2 = 250°c and have emissivities .45 and .8, respectively. determine the net rate of radiation heat transfer between the two spheres per unit surface area.
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
Questions on the website: 13722361