When do you know you have processed every digit?

Responsive Centered Red Button

Need Help with this Question or something similar to this? We got you! Just fill out the order form (follow the link below), and your paper will be assigned to an expert to help you ASAP.

In this project you will contemplate the persistence of a positive non-zero integer n. The persistence of n is computed by multiplying all the digits of n by each other, then repeating this process with the product until a single digit is obtained. The number of repetitions we must perform is the persistence.
For example, the number n = 715 has persistence 3. The sequence is 715, 35, 15, 5. To successfully complete this assignment you must write two methods.
ˆ A method that takes, as input, a positive non-zero integer n and returns the product of the digits of n. To write this method you will need to construct a while loop that computes a running product as the digits of the number are processed from right-to-left.
You will want to use the modulus (%) and division (/) operators in the body of the loop to help you process the right most digit. Notice that n % 10 gives us the right most digit of an integer. Also, recall that n / 10 removes the right most digit when we work with integers. What happens if you do this in a loop, that at each iterations replaces n with n / 10? When do you know you have processed every digit?
As a note, the parameter name should not be n this is just for illustrative purposes.
ˆ A method that takes, as input, an integer, n, greater than zero and returns the persistence. You should use a while loop and the method above to complete this task. As a note the parameter name should not be n this is just for illustrative purposes.
The main method is responsible for continually prompting the user for an integer until they enter an integer greater than zero (think data validation loop). The main method should then call the method that computes the persistence of the number and display the result.
You should write JUnit tests for both of the methods I asked you to implement above. Please construct several test cases for each method.
For the PSL portion of this assignment you are required to provide me with the PSL for the method to determine a numbers persistence. For the third step of the PSL (i.e., the design step) you are required to give me a flow chart. You are not required to provide traces
for this project. I would still perform steps 1 – 3 of PSL on the other methods but, I will not be grading those.
Grading
ˆ The first three steps of the Problem Solving Lifecycle (PSL) as described above (20 points).
ˆ Program follows department style guidelines, as taught in class. (10 points). ˆ Program has good comments (including header comment) (10 points). ˆ Program correctly uses a data validation loop to validate input (5 points). ˆ Program produces correct answer for given inputs (5 points).
ˆ Program has JUnit test cases testing the two methods (10 points). ˆ Correctly created a method to multiply the digits of a number (20 points). ˆ Correctly created a method to compute a numbers persistence (15 points). ˆ Program output matches format specified in assignment exactly (5 points).

How to create Testimonial Carousel using Bootstrap5

Clients' Reviews about Our Services