Question: Need assistance with this java code 2. Sum the cubes of digits in an integer number: Write, compile and run a Java program called SumDigitCubes.java

Need assistance with this java code

2. Sum the cubes of digits in an integer number: Write, compile and run a Java program called SumDigitCubes.java that reads an integer between 0 and 1000 and adds the cubes of all the digits in the integer. For example, if an integer is 432, the sum of the cubes all its digits is 4 3 + 33 + 23 = 64 + 27 + 8 = 95. [Hint: Use the % operator to get the digits]. 10 points

First Run

Enter an integer between 0 and 1000: 432

8

27

64

The sum of the digits in 432 is 99

Second Run Enter an integer between 0 and 1000: 349

729

64

27

The sum of the digits in 349 is 820

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!