[SOLVED] SOLVED: Lottery

15.00 $

Programming resource
Digital learning resource
Category:
Practical programming resource
Suitable for guided study and reference
Tutor guidance available when needed

Description

5/5 - (1 vote)

CMIS 141 7984 Introductory Programming (2158) Write a Java program to simulate a pick 3, 4 or 5 lottery drawing. A lottery game of this type will draw values between 0 and 9. You should use the Math.Random() or the java.util.Random() class to generate the values in the lottery drawing. The program should prompt the user for which lottery game they want to play. The program should also ask how many times they want to play the game. The output should show the numbers picked for each game and the sum of the numbers of all games. Here is a sample run: Which lottery game do you want to play (Enter 3 for pick-3, 4 for pick-4 or 5 for pick-5? 3 How many games would you like to play? 10 Thank you! The numbers selected were: 3 4 9 2 4 7 3 3 1 0 3 2 9 3 1 9 2 4 4 5 2 1 1 0 0 1 7 8 6 3 The sum for all numbers picked was: 107

Resource details

Understand the Task Before You Use the Resource

Review the requirements, identify the programming concepts involved, study the implementation and test your understanding with your own examples and modifications.