Question: Write pseudocode for an algorithm that determines if a three-digit number equals the sum of each digit cubed. The algorithm will check each three-digit number
Write pseudocode for an algorithm that determines if a three-digit number equals the sum of each digit cubed. The algorithm will check each three-digit number (100-999) and will print the number if the sum of each digit cubed equals the number. You MUST use a while loop to do this. Be sure that your pseudocode is completely refined as shown in Figure 4.11 on page 131. Name the pseudocode file a3pseudocode. Create the pseudocode BEFORE you write the program. Use an editor like Notepad or TextEdit for the pseudocode.
For example, 153 equals the sum of each digit cubed: 1*1*1 + 5*5*5 + 3*3*3 = 1 + 125 + 27 = 153 Note: pseudocode is NOT actual code. Do NOT use any Java-specific terms, such as Java print methods, in your pseudocode. Do NOT put the class or main into your pseudocode. Be sure to put your name and all other required information in your pseudocode file.
Create a program with class name CubeSum and file name CubeSum.java. Convert your pseudocode to Java code. You must print all three-digit numbers that are equal to the sum of each digit cubed. You MUST use a while loop to do this. The range of three-digit numbers is 100-999. You must use ONLY integers. Label your output. All code must be done in main do NOT create any other methods. Use the command prompt window (terminal) for output. There is NO user input for this program. You must follow all Programming Guidelines. You must comment your code. Your name must appear in the output. Your program must compile in order to be graded. Do NOT use Eclipse, NetBeans, or IntelliJ for any labs or assignments. Do NOT create packages or projects; otherwise, I will not be able to grade your assignment.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
