Question: below is my Java code please help me with exception handing where input is negative and greater than 8 __________________________________________ import java.util.Scanner; import java.util.Random; public

below is my Java code please help me with exception handing where input is negative and greater than 8 __________________________________________ import java.util.Scanner; import java.util.Random; public class main { //Static and final class member called _ with a value of 8 private static final int Max_PLAYS =8; //landing obejct private int landings[]; /** * this is main methoad for runinig simulatePlay * @param play * Using Javas random number generator class, generate a random number to simulate the throw of the ball. * */ public void simulatePlay(int play ){ int hallValue, n; Random randnNum = new Random(); // set landing to new array landings = new int[play]; // for loop for play for(int i=1; i=6 && n =16 && n =31 && n =46 && n  Max_PLAYS); main object = new main(); object.simulatePlay(play); object.showStats(); sc.close(); } } below is my Java code please help me with exception handing where

Figures: Enter the number of plays (1-8)? O Invalid input. Please enter a number between 1 and 8. Enter the number of plays (1-8)? -1 Invalid input. Please enter a number between 1 and 8. Enter the number of plays (1-8)? 100 Invalid input. Please enter a number between 1 and 8. Enter the number of plays (1-8)? Figure 2: Invalid entry message and re-prompt Enter the number of plays (1-8)? 5 Rolling ball #1. Landed in o Rolling ball #2. Landed in 10 Rolling ball #3. Landed in 20 Rolling ball #4. Landed in 80 Rolling ball #5. Landed in 40

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!