Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Java and random numbers help Part 1: Open Eclipse and, from scratch, create a program to: **For Part 1 of the lab, no loops or

Java and random numbers help image text in transcribed
Part 1: Open Eclipse and, from scratch, create a program to: **For Part 1 of the lab, no loops or arravs ...please copy \& paste to help speed up development -Use the Random class to generate 5 random numbers plus an additional number representing the "Powerball" number. To keep things simple, don't worry about duplicate numbers. -Declare constants for the Lower and Upper range of the possible random numbers (use 1-99) and use within your program. -Display the winning numbers plus the Powerball number. -Have the user enter in the 5 numbers on their ticket followed by their PowerBall number. -Determine and display if they are a winner, based on the following: - If Powerball and all 5 numbers match, display a message "All numbers plus Powerball Match! You've won the Grand Prize of 6.5 million dollars!" - If they match all 5 numbers but NOT the Powerball, display the message "All 5 numbers match (but not the Powerball). You've won 1 million dollars!" - If they only match the Powerball, then display the message "Your Powerball number matches! You've won $1,000 dollars!" - Otherwise display the message, "None of your numbers are winners. Try again soon!" Part 2: (REQUIRED) You do NOT need to DEMO Part 1 first before completing Part 2 -Once Part 1 runs correctly and you have tested it thoroughly, add a simple error check so only the correct range of numbers, using your constants, can be entered by the user. So, if 333 is accidently entered for 33 , the program will require that they re-enter the number. Here is the pseudocode....(use copy and paste on each value) if (value typed in is out of range) \{ -Display error msg -Ask to re-enter number -Read in number and re-assign

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Understanding Oracle APEX 5 Application Development

Authors: Edward Sciore

2nd Edition

1484209893, 9781484209899