Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

2:17 Lab01.docx The exercise is a modification of a program listing found on pages 98-99 of the textbook. The original program operates as follows a.

image text in transcribed
2:17 Lab01.docx The exercise is a modification of a program listing found on pages 98-99 of the textbook. The original program operates as follows a. Math.random is used to generate and save a b. The user is prompted to enter a 3-digit guess c. The user guess-value is read from the d. The lottery-winning number is broken down lottery-winning, three-digit number as one 3-digit number keyboard and saved into its three component digits, which are thern saved for later use. e. The user-guess number is broken down into its three component digits, which are then compared to the winning digits and the user is informed of a loss or an amount won. The exercise that you will complete will enhance the program to use lottery-winning numbers and user-guesses of 3 digits instead of two. A 3-digit number is not 3 1-digit numbers, read separately Testing: Your program should be tested using values which both lose and win in any of the three ways. Sample input should include -win $1000 win $2000 -win $3000 S10000 3-digit number- match 1 digit, any order Match all digits, exact order If incorrect input is entered (more than 3 digits or fewer than 3 digits) the program will not crash. It will inform the user of incorrect input and skip over the tests for and allow the user to try again (with a new lottery number). winning digits Open With Print

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

Students also viewed these Databases questions

Question

What were your most important educational experiences?

Answered: 1 week ago

Question

How was your life influenced by those events?

Answered: 1 week ago

Question

Which of these influenced your life most dramatically?

Answered: 1 week ago