Question: Write a Java program to generate 6 random lottery numbers. Your program should generate 5 numbers between 1 and 60. Use a for loop

Write a Java program to generate 6 random lottery numbers. Your program 

Write a Java program to generate 6 random lottery numbers. Your program should generate 5 numbers between 1 and 60. Use a for loop to control the 6 iterations. Output the numbers to the command line on a single line e.g.: 6 14 51 35 22 43. (2 points) Write a Java program to accept positive integers from the user at the command line. The user can enter as many integers as they like. Use -1 as a sentinel. Keep track of the highest number (the max) they enter. When done output: "The max was X" where X is this highest integer. (2 points)

Step by Step Solution

3.35 Rating (164 Votes )

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock

Here are the Java programs 1 Program to generate 6 random lottery ... View full answer

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 Programming Questions!