Question 1. A charity foundation holds yearly meetings for the public to donate money through sharing in a lottery. As a
-
- Site Admin
- Posts: 899603
- Joined: Mon Aug 02, 2021 8:13 am
Question 1. A charity foundation holds yearly meetings for the public to donate money through sharing in a lottery. As a
Question 1. A charity foundation holds yearly meetings for the public to donate money through sharing in a lottery. As a software engineer you were asked to develop a Java program for the charity foundation that works as follows: The Java program prompts the user to input his/her name as a string. The program prompts the user to enter a two-digit integer The program generates the WINING number which is composed of randomly generated two- digit number The user wins the lottery based on the following rules: a) If the user input matches the WINING number in exact order, the award is $1,000. b) If the two digits in the user input match the two digits in the lottery, the award is $500. c) If one digit in the user input matches a digit in the lottery, the award is $100. The following are samples of screen shots to illustrate the expected behavior of your program. Your program must display the same information with the same format. And should work for any valid user entered data. Welcome to the charity Lottery Enter your name: Sarah Pick a two-digit number: 42 The lottery number is 42 Congratulations! Sarah you win $1000 Welcome to the charity Lottery Enter your name: Steve Pick a two-digit number: 45 The lottery number is 49 Congratulations! Steve you win $100 Welcome to the charity Lottery Enter your name: Maria Pick a two-digit number: 27 The lottery number is 65 Sorry! Maria Good luck next time