Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Please I need in JAVA. please attach a copiable code. Qn9 (Optional, 10 bonus points)Create a lottery game application. Generate three random numbers (Math.random()), each

image text in transcribedimage text in transcribedPlease I need in JAVA. please attach a copiable code.

Qn9 (Optional, 10 bonus points)Create a lottery game application. Generate three random numbers (Math.random()), each between 0 and 9. Allow the user to guess three numbers. Compare each of the user's guesses to the three random numbers and display a message that includes the user's guess, the randomly determined three-digit number, and the amount of money the user has won as follows: Matching Numbers Any one matching Two matching Three m ching, not in order Three matching in exact order No matches Award ($) 10 100 1,000 1,000,000 0 Note: Make certain that your application accommodates repeating digits. For exam- ple, if a user guesses 1, 2, and 3, and the randomly generated digits are 1, 1, and 1, do not give the user credit for three correct guessesjust one. Save the file as LotteryXX.java. Note that for your submission, you need to replace XX with your . Your application should be able to let user choose if he/she wants to play the game again. Qn3 (6 points, 2 points each) Rewrite the following expressions using the conditional operator. (Assume that all variables are declared properly.) (a) if (x >= y) y; z X else z = y X; (b) if (hours >= 40.0) wages 40 * 7.50 + 1.5 * 7.5 * (hours - 40); else wages = hours * 7.50; (c) if (score >= 60) str "Pass"; else str "Fail"; =

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

Microsoft Visual Basic 2008 Comprehensive Concepts And Techniques

Authors: Gary B. Shelly, Corinne Hoisington

1st Edition

1423927168, 978-1423927167

More Books

Students also viewed these Databases questions