Module 3 - Lab - Parking Permit
Objective
The objective of this lab assignment is to provide you with a comprehensive hands-on experience in object-oriented programming using Java. You will be creating multiple classes that interact with each other, which will help you gain a deeper understanding of key object-oriented programming concepts. The specific skills you will be applying include creating classes, implementing encapsulation, and using constructors, with a particular emphasis on copy constructors.
Instructions:
Create the
ParkingPermit
class: This class will have the attributes:permitID
,carMake
,carModel
, andcarYear
.1.1.
permitID
will be a random number between 1000 and 9999 generated by the program. This attribute should only have a getter method.The number will be genertated in the class.1.2. The
carMake
,carModel
, andcarYear
attributes will be set by user input.1.3. Include a copy constructor in this class.
Create the
Student
class: This class will have the attributes:firstName
,lastName
,address
, andparkingPermit
.2.1. The
firstName
andlastName
attributes will be set by user input.2.2. The
address
attribute will be an object of a classAddress
you created in Module 3, Lab 1.2.3. The
parkingPermit
attribute will be an object of theParkingPermit
class you just created.Create the
Header
class: This class will contain a static method that displays a welcome message to the user. The Header class should be static and provide a message that outputs: “Welcome to the Alamo College Parking System”Write your main program:
4.1. First, use the
Header
class to display the welcome message.4.2. Use the
Scanner
class to collect user input for the student's first name, last name, home address, and car information (make, model, and year).4.3. Instantiate the
ParkingPermit
class with the car information provided by the user, and instantiate theStudent
class with the student information and theParkingPermit
object created in the previous step.4.4. Finally, output the student's information and parking permit details in a creative format.
Please ensure your code follows the best practices for writing clean and efficient code, such as appropriate naming conventions and including comments to describe your code.
Deliverables
Upload the following files in a zip folder that you have created:
Java class files
Screenshot of the Console with the code executing
COSC-1437 / ITSE-2457 Computer Science Dept. - Author: Dr. Kevin Roark