Very Exciting Intro To Java Not-A-Quiz (Chapters 1--3)
- This not-a-quiz is open book, open notes, open Internet, etc.
- It is NOT a group not-a-quiz.
- Regardless of your success on this not-a-quiz, please
use this as a chance to measure how capable you, personally, are at solving
these problems alone. If you feel really confused, do not pretend that the
confusion will fade away. Please come and talk to me before it gets worse.
- Don't panic. It's just a not-a-quiz.
1. In a Java application, write a method distance which
takes four floating point numbers, x1, y1, x2, and y2 which represent two points.
It returns the distance between (x1, y1) and (x2, y2).
Note very carefully the example usage. You are writing a function that returns
a number. You are not writing a function that prints anything.
System.out.println(distance(1.0,2.0,-4.0,14.0)); // prints 13.0
2. Create an applet or JFrame which has the following properties:
- It should have a background color of Color.YELLOW. It is a very sunny day.
- It should have a picture of a car. You know what a car is. Make one that
amuses you. When you are done making the car, show it to me so I can see it.
(Note: If you actually are allowed to drive a car and do not know what one
looks like, I may have to fail you on this not-a-quiz for your own good. Or at least
my own good.)