University Java Programming Project: Car Parking System Prototype
VerifiedAdded on 2021/04/21
|18
|2592
|357
Project
AI Summary
This Java programming project models a car parking system. The system records customer data and generates two ticket types: season and general. Season tickets offer various durations (12 months, 6 months, etc.), while general tickets are calculated based on the day of the week and time of day. The prototype, implemented in a local Java editor, simulates the application layer, including customer registration, ticket selection, and payment processing, although without database integration or hardware connections. The code includes classes for Customer and Ticket, along with methods for ticket generation and payment simulation. The system considers assumptions like manual customer identification and focuses on core functionalities. The project demonstrates the use of Java programming concepts such as constructors, methods, and user input through the Scanner class. The project aims to provide an understanding of how an application layer of a car parking system could work. The project concludes with a bibliography of relevant resources.

Running head: ASSESSMENT 3: JAVA PROGRAMMING
Assessment 3
Name of the Student
Name of the University
Assessment 3
Name of the Student
Name of the University
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

1ASSESSMENT 3: JAVA PROGRAMMING
Table of Contents
Introduction: 2
The System Overview: 2
Assumptions: 2
Developed Prototype: 2
Conclusion: 15
Bibliography: 16
Table of Contents
Introduction: 2
The System Overview: 2
Assumptions: 2
Developed Prototype: 2
Conclusion: 15
Bibliography: 16

2ASSESSMENT 3: JAVA PROGRAMMING
Introduction:
The java programming language has been chosen for building up the model of the
COLLIN’S car parking system. The java Programming is the protest arranged displaying that
permits making a code dynamic and information dealing with better. Over-burdening of
techniques has been utilized inside the programming. The programming does not cover every
one of the parts of the framework as with a specific end goal to that IoT is required. The model
form of the framework gives appropriate downplaying of the framework functionalities.
The System Overview:
The proposed system is a car parking system that records the customer data and generate
tickets. The parking management system is used for detecting the presence of the cars in the
parking area. There are two types of customers, seasonal and general. The System generates two
types of tickets such as season and general. The season tickets are six types. The seasonal
customer can choose among 12 months, 6 months, 3 months, 1 month, 2 weeks or 1 week tickets.
The user will select the ticket type during registration. The ordinary tickets will be generated
automatically based on the day of week and time of the day.
Assumptions:
During developing the application, it was assumed that the system will not be able to
identify the customers automatically. The system is used for storing the ticket and customer data
only. The administrator will not have an interface to interact with.
Introduction:
The java programming language has been chosen for building up the model of the
COLLIN’S car parking system. The java Programming is the protest arranged displaying that
permits making a code dynamic and information dealing with better. Over-burdening of
techniques has been utilized inside the programming. The programming does not cover every
one of the parts of the framework as with a specific end goal to that IoT is required. The model
form of the framework gives appropriate downplaying of the framework functionalities.
The System Overview:
The proposed system is a car parking system that records the customer data and generate
tickets. The parking management system is used for detecting the presence of the cars in the
parking area. There are two types of customers, seasonal and general. The System generates two
types of tickets such as season and general. The season tickets are six types. The seasonal
customer can choose among 12 months, 6 months, 3 months, 1 month, 2 weeks or 1 week tickets.
The user will select the ticket type during registration. The ordinary tickets will be generated
automatically based on the day of week and time of the day.
Assumptions:
During developing the application, it was assumed that the system will not be able to
identify the customers automatically. The system is used for storing the ticket and customer data
only. The administrator will not have an interface to interact with.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

3ASSESSMENT 3: JAVA PROGRAMMING
Developed Prototype:
As the developed prototype is implemented in the local system java editor, it is not
connected to any of the hardware like pillars, display, money collector and other things. As no
database has been used for storing the customer data, the user has to insert his name every time
he try to purchase a ticket. The prototype does not generate any ticket physically or actually
accept payment from user. Rather the processes are presented through printing on the screen. The
developed prototype has been generated for providing an idea about how the application layer of
the system will perform. It does not include, presentation or data layer.
Customer(int cid, String name, String address, String email, int contact){
this.cid=cid;
this.name=name;
this.address=address;
this.email=email;
this.contact=contact;
}
The above code refers to the constructor of the Customer class. The parameters defined in
the constructor is for storing the customer data. The screen shot provides an idea about what the
constructor does.
Developed Prototype:
As the developed prototype is implemented in the local system java editor, it is not
connected to any of the hardware like pillars, display, money collector and other things. As no
database has been used for storing the customer data, the user has to insert his name every time
he try to purchase a ticket. The prototype does not generate any ticket physically or actually
accept payment from user. Rather the processes are presented through printing on the screen. The
developed prototype has been generated for providing an idea about how the application layer of
the system will perform. It does not include, presentation or data layer.
Customer(int cid, String name, String address, String email, int contact){
this.cid=cid;
this.name=name;
this.address=address;
this.email=email;
this.contact=contact;
}
The above code refers to the constructor of the Customer class. The parameters defined in
the constructor is for storing the customer data. The screen shot provides an idea about what the
constructor does.
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

4ASSESSMENT 3: JAVA PROGRAMMING
The customer enters name and other details in the application.
System.out.println("Enter Customer Name");
n = sc.nextLine();
System.out.println("Address\n");
The above code displays the customer data after all the data are stored. The below screen
shot present the customer data.
cust.TicketGeneration(n);
The java application calls the
ad = sc.nextLine();
System.out.println("Email\n");
e = sc.nextLine();
System.out.println("Contact\n");
The customer enters name and other details in the application.
System.out.println("Enter Customer Name");
n = sc.nextLine();
System.out.println("Address\n");
The above code displays the customer data after all the data are stored. The below screen
shot present the customer data.
cust.TicketGeneration(n);
The java application calls the
ad = sc.nextLine();
System.out.println("Email\n");
e = sc.nextLine();
System.out.println("Contact\n");

5ASSESSMENT 3: JAVA PROGRAMMING
co = sc.nextInt();
The above code shows the messages application shows during customer data entry and
java user input code. The scanner class is used in java to collect data from the user. In terms of
String other methods can be used but nextLine() method of scanner class have been used for
collecting string data like name, address and email. The nextInt for collecting integer type data
likecontact.
cust = new Customer(cid, n, ad, e, co);
The above code illustrates that the cust object has been created under Customer class.
During the object creation the cid, n, ad, e and co data are sent to the constructor mentioned
before to store the customer details.
void Display(){
System.out.println("Customer Details\n" + "name: " + name + " " +
"address: " +address + " " + "email: " + email + " " + "contact: " + contact);
}
cust.TicketGeneration(n);
The java application calls the TicketGeneration method after customer data is displayed.
void TicketGeneration(String nm){
this.nm=nm;
co = sc.nextInt();
The above code shows the messages application shows during customer data entry and
java user input code. The scanner class is used in java to collect data from the user. In terms of
String other methods can be used but nextLine() method of scanner class have been used for
collecting string data like name, address and email. The nextInt for collecting integer type data
likecontact.
cust = new Customer(cid, n, ad, e, co);
The above code illustrates that the cust object has been created under Customer class.
During the object creation the cid, n, ad, e and co data are sent to the constructor mentioned
before to store the customer details.
void Display(){
System.out.println("Customer Details\n" + "name: " + name + " " +
"address: " +address + " " + "email: " + email + " " + "contact: " + contact);
}
cust.TicketGeneration(n);
The java application calls the TicketGeneration method after customer data is displayed.
void TicketGeneration(String nm){
this.nm=nm;
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

6ASSESSMENT 3: JAVA PROGRAMMING
Ticket.TicketBook();
System.out.println(nm + " " + "Your ticket number is: " +
Ticket.TicketNumber + " \nDo you want to pay?" + " $" + Ticket.TicketCharge);
Scanner s=new Scanner(System.in);
char c= s.next().charAt(0);
if (c == 'y' || c == 'Y')
Payment.makePayment();
else
System.out.println ("Payment Failed");
}void TicketGeneration(String nm){
this.nm=nm;
Ticket.TicketBook();
System.out.println(nm + " " + "Your ticket number is: " +
Ticket.TicketNumber + " \nDo you want to pay?" + " $" + Ticket.TicketCharge);
Scanner s=new Scanner(System.in);
char c= s.next().charAt(0);
if (c == 'y' || c == 'Y')
Payment.makePayment();
Ticket.TicketBook();
System.out.println(nm + " " + "Your ticket number is: " +
Ticket.TicketNumber + " \nDo you want to pay?" + " $" + Ticket.TicketCharge);
Scanner s=new Scanner(System.in);
char c= s.next().charAt(0);
if (c == 'y' || c == 'Y')
Payment.makePayment();
else
System.out.println ("Payment Failed");
}void TicketGeneration(String nm){
this.nm=nm;
Ticket.TicketBook();
System.out.println(nm + " " + "Your ticket number is: " +
Ticket.TicketNumber + " \nDo you want to pay?" + " $" + Ticket.TicketCharge);
Scanner s=new Scanner(System.in);
char c= s.next().charAt(0);
if (c == 'y' || c == 'Y')
Payment.makePayment();
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

7ASSESSMENT 3: JAVA PROGRAMMING
else
System.out.println ("Payment Failed");
}
The above method is the TicketGeneration method. The Ticket.TicketBook(); method
defined in the Ticket class has been called in the TicketGeneration method.
The TicketBook method first asks the customer to select the ticket type.
static void TicketBook(){
System.out.println("Choose your option\n 1. Season Ticket \n 2. Genral
Ticket");
int option = 0;
int z = 1;
while(z == 1){
option = s.nextInt();
if(option == 1){
setData();
System.out.println("Your season ticket is confirmed please
proceed to pay");
z = 0;
else
System.out.println ("Payment Failed");
}
The above method is the TicketGeneration method. The Ticket.TicketBook(); method
defined in the Ticket class has been called in the TicketGeneration method.
The TicketBook method first asks the customer to select the ticket type.
static void TicketBook(){
System.out.println("Choose your option\n 1. Season Ticket \n 2. Genral
Ticket");
int option = 0;
int z = 1;
while(z == 1){
option = s.nextInt();
if(option == 1){
setData();
System.out.println("Your season ticket is confirmed please
proceed to pay");
z = 0;

8ASSESSMENT 3: JAVA PROGRAMMING
}
else if (option == 2)
{
setData2();
System.out.println("Your ordinary ticket is confirmed please proceed to
pay");
z = 0;
}
else
{
System.out.println("The entered option is invalid");
System.out.println("Please choose again");
}
}
}
The customer first chooses the ticket type by pressing 1 or 2.
}
else if (option == 2)
{
setData2();
System.out.println("Your ordinary ticket is confirmed please proceed to
pay");
z = 0;
}
else
{
System.out.println("The entered option is invalid");
System.out.println("Please choose again");
}
}
}
The customer first chooses the ticket type by pressing 1 or 2.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide

9ASSESSMENT 3: JAVA PROGRAMMING
If the customer selects the ‘option 1’ then season ticket is generated.
if(option == 1){
setData();
System.out.println("Your season ticket is confirmed please
proceed to pay");
z = 0;
}
The setData() method is called before the println function. In the setData method the user
first select the type of season ticket.
private static void setData() {
Scanner sc=new Scanner(System.in);
TicketNumber = 1+TicketNumber;
System.out.println("Select Ticket Type 1. 12 months 2. 6 Months 3. 3
Months 4. 1 Month 5. 2 Weeks 6. 1 Week");
int c = sc.nextInt();
TicketCharge = TicketType(c);
if (c==1)
If the customer selects the ‘option 1’ then season ticket is generated.
if(option == 1){
setData();
System.out.println("Your season ticket is confirmed please
proceed to pay");
z = 0;
}
The setData() method is called before the println function. In the setData method the user
first select the type of season ticket.
private static void setData() {
Scanner sc=new Scanner(System.in);
TicketNumber = 1+TicketNumber;
System.out.println("Select Ticket Type 1. 12 months 2. 6 Months 3. 3
Months 4. 1 Month 5. 2 Weeks 6. 1 Week");
int c = sc.nextInt();
TicketCharge = TicketType(c);
if (c==1)
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser

10ASSESSMENT 3: JAVA PROGRAMMING
Months = 12;
else if (c==2)
Months = 6;
else if (c==3)
Months = 3;
else if (c==4)
Months = 1;
else if (c==5)
Months = 0.5;
else
Months = 0.25;
TicketCharge = TicketPrice(c);
Ticket t = new Ticket (TicketNumber, TicketCharge, Months);
}
As it can be seen the above diagram and code, based on the selection of the user, the
system assigns value to the ‘months’ variable. After the value is assigned then the application
calls TicketPrice method to set the type of ticket to be generated. So in these two methods, the
application assigns the ticket duration and price.
Months = 12;
else if (c==2)
Months = 6;
else if (c==3)
Months = 3;
else if (c==4)
Months = 1;
else if (c==5)
Months = 0.5;
else
Months = 0.25;
TicketCharge = TicketPrice(c);
Ticket t = new Ticket (TicketNumber, TicketCharge, Months);
}
As it can be seen the above diagram and code, based on the selection of the user, the
system assigns value to the ‘months’ variable. After the value is assigned then the application
calls TicketPrice method to set the type of ticket to be generated. So in these two methods, the
application assigns the ticket duration and price.

11ASSESSMENT 3: JAVA PROGRAMMING
The last message shown in the above diagram is within the TcketBook method.
System.out.println("Your season ticket is confirmed please proceed to pay");
Ticket t = new Ticket (TicketNumber, TicketCharge, Months);
The above code defines the assign of value to the t objects variable through constructor.
The constructor has three variables for ticket number, ticket price and duration storing purpose.
Ticket(int TicketNumber, int TicketCharge, double Months){
this.TicketNumber = TicketNumber;
this.TicketCharge = TicketCharge;
this.Months = Months;
}
The above constructor is for season tickets where tickets are generated for limited period.
static int TicketNumber;
static int TicketCharge;
static double Months;
The above three variables are used for storing the ticket data.
The last message shown in the above diagram is within the TcketBook method.
System.out.println("Your season ticket is confirmed please proceed to pay");
Ticket t = new Ticket (TicketNumber, TicketCharge, Months);
The above code defines the assign of value to the t objects variable through constructor.
The constructor has three variables for ticket number, ticket price and duration storing purpose.
Ticket(int TicketNumber, int TicketCharge, double Months){
this.TicketNumber = TicketNumber;
this.TicketCharge = TicketCharge;
this.Months = Months;
}
The above constructor is for season tickets where tickets are generated for limited period.
static int TicketNumber;
static int TicketCharge;
static double Months;
The above three variables are used for storing the ticket data.
⊘ This is a preview!⊘
Do you want full access?
Subscribe today to unlock all pages.

Trusted by 1+ million students worldwide
1 out of 18
Related Documents

Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
Copyright © 2020–2025 A2Z Services. All Rights Reserved. Developed and managed by ZUCOL.