CECS 277
LAB ASSIGNMENT #5
Assigned date: 10/24
Due date: 10/31

20 points

Problem 1 [10 points]Writing a simple lottery program. The program should randomly generates a wining lottery ticket, them prompt the player to enter a lotto numbers. Depending on how many numbers match, the player wins various prizes.

Sample output

Type 6 lotto numbers: 4  12  7  35  20  1
Your ticket was: [ 4, 12, 7, 35, 20, 1]
Winning numbers: [ 2, 13, 27, 7, 11, 4]
Match numbers: [4,7]
Your prize is $500.00

Requirements: Inplement the following methods in your program

GRADING

Problem 2 [10 points] Write a program that find the words that occur most frequently in the book. To do this, we should count how many times each word in the book occurs, then examine all of these counts and print the ones with the largest values. Assume the book is a file named book.txt. Create your own file for testing. Use a Map to store the word counts. The frequently used words should be shown in alphabetical order. Create a method that reads the book text and returns a map from words to counts. The method should have an argument Scanner object.

Use the following data file:

data.txt

GRADING