Question: 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.

 2:17 Lab01.docx The exercise is a modification of a program listing

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!