Question: Write a Java program with three classes in three separate source code files. The first class is Person. A Person has a name, age, height,
Write a Java program with three classes in three separate source code files.
The first class is Person. A Person has a name, age, height, and ability to drive a stick shift yes or no
The second class is Car. A Car has a make, model, year, color, headroom, transmission manual or automatic and a driver who is a Person.
Both Car and Person must demonstrate encapsulation and have a toString method.
The third class is CarAndDriver. This class will have a runnable interface main method.
When run, the program should print out the course, assignment, date, and student name to the screen. Then the program will create three objects of type Car, with the programmers choices of values. At least one car must be a manual transmission.
The program will prompt the user for driver information, asking for name, age, height, and ability to drive a stick. The program will use this data to create an object of type Person. This Person will be assigned as the driver of a Car. Repeat for all three cars.
The program will then print a report to the screen detailing the values of each car and driver. An error should be printed for drivers who are too tall for their cars or who are not able to drive a manual transmission car they are assigned to
Turn in:
Program documentation as described in Project
Three java source code files
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
