Unit 2 Assignment

Read  about each program.  Decide which one you would like to do.  There are sample runs for each.

You get no help on these.  I will grade them only once. 
If it does not work correctly when you call me to grade, I take off 5 points.
For bad spacing ( touching things) -1 for each time

Late programs will be penalized 10%

Password Program - 85 points

Open Lab2c4 - about the password. Save as U2p1

We are going to make the program look more like a real log-in.
This program is very similar to the even/odd that we did in class when we went over Lab2d

1. Add a variable as the ID number similar to the the way we declared a password. This can be an integer or a String.
        If you make it an integer, you will need a parseInt later on but can use ==
        If you make it a String, you do not have to use parseInt but you do have to use the .equals() method for comparisons.
   2. Add another InputDialog before the InputDialog that asks for the password.

   3. The program should tell me one of 3 things
        a.  I may enter the web site (same as the Lab assignment)
       

b.  when I have entered some data incorrectly

  c. when all data I entered is incorrect


       

 

Triangle program - 100 points

It uses your knowledge about triangles. It is similar to Lab2d4. I would suggest starting there and save as U2p2.

The sum of the angles of a triangle is 180 degrees. If the sum is more than 180 or less than 180, the triangle does not exist.
Once you know that the triangle exists, then you can figure out:
   -->
is it a right triangle ( one angle equal to 90 degrees)
  ---> is it an obtuse triangle ( one angle is greater than 90 degrees)
  ---> is it an acute triangle ( all angles are less than 90 degrees)

Here are some sample runs: