7A

Finish the InputWork class 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: "); Copy and paste it. That is what I did when I coded the model solution.

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"

Hint: To find the next to the smallest, you will need two variables, min and secondMin. You can not initialize them to 0 since the numbers can be negative, so use a boolean flag first (see Udacity videos), and if first is true (this is the first time through the loop), initialize both min and secondMin to the first input and set first to false. When you read a number, if it is smaller than min, set secondMin to the value of min and assign the new input to min. If the input is greater than min but less than secondMin, set secondMin to the input.

For the draft, read the numbers and print them, one to a line. Quit on a non-integer. Use the prompt given above.

7A draft:
7A final:

7B

Complete the TenCircle class to draw ten circles that have radius of 10, 20, ..., 100. They touch the line x = 0 at the left and the line y = 200 at the bottom. (are tangent to the line) Draw the smallest circle first. You must use a loop in your solution.

Another way to look at this is that the circles are inside a right angle consisting of the lines x = 0 and y = 200. The circles are tangent to the sides of the right angle.

Here is an image.

screen shot

You will receive no credit for a solution that draws ten separate circles even if it passes Codecheck.

For the draft: just draw the first circle

7B draft:
7B final:

7C

Write a class CharacterSearch.

It has a constructor that takes a string consisting of one character as a parameter. If the String contains more than one character. Use the first character, and assign it to the instance variable, character.

It has methods:

For the draft, implement the constructor and implement the methods as stubs. Provide Javadoc

7C draft:
7C final: