Question: Write a method that does the following: 1) takes an integer value as a parameter 2) returns false if the parameter is less than 1

Write a method that does the following:

1) takes an integer value as a parameter

2) returns false if the parameter is less than 1

3) uses a while loop to decrement the parameter by 1 until it reaches 0

4) Prints the sum of the parameter * 10 each iteration of the while loop

5) returns true at the completion of the while loop

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!