Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Design a lottery system that does the following: The computer randomly generates 6 random numbers between 1 - 9 0 without repetition. The user can

Design a lottery system that does the following:
The computer randomly generates 6 random numbers between 1-90 without repetition.
The user can guess the lucky number.
The user can only enter a minimum of 2 guesses or a maximum of 6 guesses.
The user can exit their entry either by entering "Q" or "Quit" and the entry automatically stops if the user enters a maximum of 6 numbers between 1 and 90 without repetition.
if the user guesses one number correctly the machine prints the user guesses, the lucky numbers and says, "Sorry you guessed only one correctly.".
if the user guesses two numbers correctly the machine prints the user guesses, the lucky numbers and says, "Congratulations you guess 2 correctly.".
if the user guesses three numbers correctly the machine prints the user guesses, the lucky numbers and says, "Congratulations you guess 3 correctly.".
if the user guesses four numbers correctly the machine prints the user guesses, the lucky numbers and says, "Congratulations you guess 4 correctly.".
if the user guesses five numbers correctly the machine prints the user guesses, the lucky numbers and says, "Congratulations you guessed 5 correctly.".
if the user guesses all 6 numbers correctly the machine prints the user guesses, the lucky numbers and says, "Congratulations you just won a Jackpot.".
NB:
Zip the file and attach it while submitting this assignment.

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

Next Generation Databases NoSQLand Big Data

Authors: Guy Harrison

1st Edition

1484213300, 978-1484213308

More Books

Students also viewed these Databases questions

Question

Explain the benefits of a health and wellness strategy

Answered: 1 week ago

Question

Describe the components of a workplace wellness programme

Answered: 1 week ago