Question: WILL LEAVE GOOD RATING. PLEASE HELP THANK YOU!! ( JAVA) Can you modify this program to Write a program that reads grades from the user
WILL LEAVE GOOD RATING. PLEASE HELP
THANK YOU!!
( JAVA) Can you modify this program to
Write a program that reads grades from the user (and computes the sum and average) so that it uses a sentinel to indicate the end of input; e.g. it asks the user to enter a grade of 0 to 100, or -1 to quit; in this example, the sentinel is -1; keep reading grades until the user enters -1. Use a constant to represent the SENTINEL.
Modify your program that reads grades from the user, so that it has a method that checks if a particular input is valid i.e. as long as the user types invalid input, the user should be given another chance to enter input (it would also be good to let the user know that their input is invalid). Moreover, only a valid grade should be used in computing the sum and average. At the appropriate point in your code, put a comment that states that the grade entered by the user has been determined to be valid. You may refer to this program that uses methods to read and validate input.
Write/modify your program that draws 2 pictures (e.g. houses) so that it uses a loop (with 2 iterations). What would you need to change if you wanted the program to draw more than 2 pictures? What kind of loop is appropriate for this?
- Tracing programs containing loops (by drawing tables and showing output; you need not write any code):
- Trace the following program assuming the user enters 3 for value and 21 for limit. Draw a table showing the values of relevant variables (value, limit, mult, count) during each iteration of the loop: Multiples.java. As you trace, keep track of the output too, and then check that your predicted output is correct by running the program.
- Trace Stars.java by drawing a table that shows the values of relevant variables (row and star) and keeping track of the output. This program contains a nested for loop, so for each iteration of the outer loop, the inner loop executes in its entirety:
row star 1 1 2 1 2 2 3 1 3 2 3 3 ... ...
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
