COSC-1336
Programming Fundamentals I
Programming Assignment 3
Revise Listing 3.8, Lottery.java, to generate a lottery of a three-digit integer. The program prompts the user to enter a three-digit integer and determines whether the user wins according to the following rules:
• If the user input matches the lottery number in the exact order, the award is $10,000.
• If all digits in the user input match all digits in the lottery number, the award is $3000.
• If one digit in the user input matches a digit in the lottery number, the award is $1000.
Your program’s output should look like the sample shown below. Green text represents information entered by the user. Black text is produced by the program.
Enter your lottery pick (three digits): 768
Lottery is 723
Match one digit: you win $1,000

Store the source code in a file named Lottery.java. For example, your instructor’s source code would be stored in a file named LotteryPeggyDoerschuk.java. In comments at the top of the source code file place the following:

Essay Mill

Share
Published by
Essay Mill

Recent Posts

Childbirth

For this short paper activity, you will learn about the three delays model, which explains…

1 month ago

Literature

 This is a short essay that compares a common theme or motif in two works…

1 month ago

Hospital Adult Medical Surgical Collaboration Area

Topic : Hospital adult medical surgical collaboration area a. Current Menu Analysis (5 points/5%) Analyze…

1 month ago

Predictive and Qualitative Analysis Report

As a sales manager, you will use statistical methods to support actionable business decisions for Pastas R Us,…

1 month ago

Business Intelligence

Read the business intelligence articles: Getting to Know the World of Business Intelligence Business intelligence…

1 month ago

Alcohol Abuse

The behaviors of a population can put it at risk for specific health conditions. Studies…

1 month ago