## Math & Scanner Lab Worksheet

**First, in Practice It! do these three Exercises:**

(0: Optional Warm Up on Math Methods: Self-Check 3.10: mathExpressions )

**Then do at least one of these three **and have it manually checked off (highly recommend doing at least the first one!). If you have more time, do all of them…

- Write a method placeCircles that has Scanner and Graphics parameters. Your method should prompt the user for a number of circles to draw then ask for information about each circle:

- If you ever find yourself buying a house, you’ll want to know what your monthly payment for the loan is going to be. Write a method that asks the user for information about a loan and prints the monthly payment.The formula for computing monthly mortgage payments involves the loan amount, the total number of months involved (a value we call
*n*) and the monthly interest rate (a value we call*c*). The payment formula is given by the following equation:An example run of your program might produce the following output (user input is underlined):This program computes monthly loan payments. Loan amount?

**275000**Number of years?**30**Interest rate?**6.75**Your payment is $1783Note that the numbers being read as input don’t match the way they should be used in the formula. The term of the loan is read as years instead of months. The interest rate percentage is being read in as a yearly rate instead of a monthly rate and as a whole number rather than a true percentage, so the value 6.75 should actually become 0.005625 by dividing it by 12 and by 100. You will have to make these conversions as part of your program.

Make sure the final printed results is in whole dollars, without any decimals!

- Write a program to produce beautiful square spirals! Your program should prompt the user for a window size and the distance between each arm of the spiral. See a sample run of the program:

(As always, big thanks to Ms. Martin for passing on these examples.)