Assignment #2 – due Thursday at 10:00 AM.


Remember to practice and experiment with the techniques we have discussed in class before worrying about the homework. If you get really comfortable with the basics, then any additional minor challenges on the homework should not be a major deal.


You may do all problems, one above the other in the same main method.  Or, you may do each of them in a separate class (i.e. in separate files). 


Problem #1: 

Have a variable called ‘age’ and hard code a value in it. Then output the cost of a movie ticket using the following business logic:

·        <12 = $5

·        65 or over, $5

·        Everyone else, $10


Problem #2:

Have a variable in which you store a integer quantity of U.S. Dollars. Initialize this variable to any amount you choose. Then create variables for euros, british pounds, and one other currency of your choice. Convert the values using the following formulas:

1 USD = 0.79 euros, 0.65 British Pounds, etc


Your output should look something like:

10 US Dollars equals:

7.9 Euros

6.5 Pounds

136.2 Mexican Pesos


Problem #3:

At a certain shop, employees make different salaries depending on the month they were born. Ask the user to enter a number between 1 and 12 representing the month they were born.  Those born in January, June, or July make $20 per hour.  Those born in Febuary, March, May, or September make $15 per hour. Everyone else makes $10 per hour.


Then ask them how many hours they worked and output their pay.

Example: Someone who enters 5 for the month (May) and worked 10 hours would make 10*$15 = $150.