7A

Complete an application called RandomNumbers to generate 50 random numbers between 20 and 30. (That is, the numbers will be one of the set {20, 21, 22, 23, 24 25, 26, 27, 28, 29}). Print the numbers 10 to a row separated by a space. Find and print the sum. Calculate the average and print it on a separate line.

The Random object has been created for you with a seed. Do not change that part of the code. The seed will cause the random number generator to generate the same numbers each time the program is run. That will allow Codecheck to grade the submission.

Define and use a local constant for the number of random numbers (50). It should only appear once in your program

For the draft, generate 5 random numbers using the Random object provided and print them on one line separated by spaces.

7A draft:
7A final:

7B

Complete the application, DecisionsWithInput to read a set of integers. Stop reading input when a non-integer is read. Use this exact prompt: System.out.print("Enter an integer or Q to quit: ");

Note: you will actually quit on any non-integer.

Do the following things

You will only read the inputs one time and do all the processing as you go. No arrays yet.

The outputs should be on separate lines and in the order given above. If there were no inputs, just print "no input"

For the draft, do not use a sentinel value. Just read 5 values and print the sum of all the odd numbers. Use a while loop. Assume the user enters only integers

7B draft:
7B final:

7C

Write an application RowsOfCats to do the following: Ask the user to enter a number between 5 and 10 (inclusive)  Use this prompt: System.out.print("Enter a number between 5 and 10: ");

Keep asking until the user enters a number in the correct range. Do not throw an exception if the user enters a non-integer. Just consume the bad data and ask again.

After you have a valid number, draw that many rows of cats pictures with one cat in the first row, two cats in the second row, and so on.  Use this image: little black catStart the first cat in the first row at 0,0.

If the user enters 6, the drawing will look like this:

screen shot of output

You will need to import the Udacity graphics package to make a Picture object

For the draft, ask the user to enter the number and keep asking until the number is in the proper range. Print the number. There will not be any non-integers input in the draft although there wall be in the final.

7C draft:
7C final: