Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

no arrays please #1 Lottery program - 8 points Develop a Java program to play the lottery. The program will randomly generate a two-digit number

no arrays please image text in transcribed
#1 Lottery program - 8 points Develop a Java program to play the lottery. The program will randomly generate a two-digit number to represent the lottery numbers (the lottery numbers are single-digit, generating a two-digit number makes this easier). The program will ask the user for a two-digit number. The program will determine if the user wins according to the following rules: 1. If the user matches the lottery numbers in exact order, the user wins $10,000 2. If the user matches both numbers, out of order, the user wins $3,000. 3. If the user matches one digit, the user wins $1,000. A sample run of this program might look like this (user input is in red): Enter your two-digit lottery numbers: 56 The lottery numbers were 25, you win $1,000. A second run of this program might look like this (user input is in red): Enter your two-digit lottery numbers: 56 The lottery numbers were 56, you win $10,000. A third run of this program might look like this (user input is in red): Enter your two-digit lottery numbers: 56 The lottery numbers were 12, you win $0

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

Relational Database And SQL

Authors: Lucy Scott

3rd Edition

1087899699, 978-1087899695

More Books

Students also viewed these Databases questions