You are on page 1of 34

THAPA

SACHIN

948

Shyam Sundar Khatiwada

CU ID: 10174711 1 Student ID: 190261


Table of Contents
Task 1 ................................................................................................................................................... 3
Introduction ............................................................................................................. 3
Features and functions............................................................................................ 4
Task 2 ................................................................................................................................................... 6
GUI.......................................................................................................................... 6
Classes ................................................................................................................. 12
Logical Functions .................................................................................................. 24
Exceptional Handling ............................................................................................ 26
Test Class and results........................................................................................... 27
Database............................................................................................................... 28
Conclusion ...................................................................................................................................... 31
References ...................................................................................................................................... 32
Plagiarism Report ........................................................................................................................ 33

CU ID: 10174711 2 Student ID: 190261


Task 1

Introduction:
The system goes by the name of "Car Rental and Parking
Management System" which is a Graphical User Interface (GUI) program written in
python. It is clear from the name that it allows users to rent a car and is also capable
of booking a parking spot for their vehicle. The system is mainly designed for two
types of users, Admin, and non-admin users. Admin can add other users to the
system and also manage the whole system by adding data of Cars that are available
for renting and can also add the name of available parking spots. While the non-
admin user can view the details of available cars and rent it for a particular time. By
viewing the available number of parking spots, they can book a spot for parking their
vehicle. All the data entered into the system is saved to the database which is written
in SQL.

To develop this system, I used Visual Studio Code (VS Code) which is a developer-
friendly code editor that supports multiple programming languages. Besides, I used
MySQL Workbench to write and run the essential SQL queries and develop a
database for the system.

CU ID: 10174711 3 Student ID: 190261


Functions and features of the system:
The main features of the system are as follows:
a) Admin functions:
 Allows login:
The system allows registered users to log in to the system by verifying
the given username and password. If the username or password is incorrect it
restricts the user from logging in into the system.

 Add available cars details:


The admin of the system can add the details of the cars which can be
rented by the users. The details such as Car Brand, Model, Price per day, and
address that it is available at can be added. The details are then stored into
the database in the cars table.

 View and delete cars:


Both admin and non-admin users are given permission to view the details of
cars that are available to rent. While only the admin can delete the details of
the car entirely from the system and database.

 View orders:
The system allows admins to view the placed orders by other users,
the order has every detail related to the car and also the address, pickup date,
and the number of days the car has been rented for.

 Register Users:
Once logged into the system, the admin can create an account of other
users by registering their details.

 Add parking spot:


Admin can also add a parking spot and give it a suitable name.
Besides, the admin can also view the details of the vehicle that booked the
parking spots.

CU ID: 10174711 4 Student ID: 190261


b) User (Non-admin) Functions:
 Rent a Car:
The user can rent any available car by viewing the location and its price.
Essential details such as pickup date and the number of days must be given
before renting the car.

 View Transaction History:


In the menu window by clicking transaction history, all the details of the
previous transaction of the particular user is shown in the new window.

 Book a Parking Spot:


The system allows users to book a parking spot by giving the details of their
vehicle and the user can choose any available parking spots.

 Message Box:
The system has a message box frame which keeps user update and notifies
if any error occurs. It also shows the number of total available parking spots.

CU ID: 10174711 5 Student ID: 190261


Task 2:
i)GUI:
a) Admin Interfaces

To access the system as admin username “admin” and password “admin” can be
used as for now.

CU ID: 10174711 6 Student ID: 190261


CU ID: 10174711 7 Student ID: 190261
CU ID: 10174711 8 Student ID: 190261
b) Non-admin user interface:

CU ID: 10174711 9 Student ID: 190261


CU ID: 10174711 10 Student ID: 190261
CU ID: 10174711 11 Student ID: 190261
ii) Classes:

a) Class MyDb:

CU ID: 10174711 12 Student ID: 190261


b) Class Admin:

CU ID: 10174711 13 Student ID: 190261


c) Class Order:

CU ID: 10174711 14 Student ID: 190261


d) Class Park:

CU ID: 10174711 15 Student ID: 190261


e) Class User:

CU ID: 10174711 16 Student ID: 190261


f) Class Log:

CU ID: 10174711 17 Student ID: 190261


g) Class Cars:

CU ID: 10174711 18 Student ID: 190261


h) Class parkDetails:

CU ID: 10174711 19 Student ID: 190261


i) Class userInterface:

CU ID: 10174711 20 Student ID: 190261


j) Class Transaction:

CU ID: 10174711 21 Student ID: 190261


k) Class placeOrder:

CU ID: 10174711 22 Student ID: 190261


l) Class Parking:

CU ID: 10174711 23 Student ID: 190261


iii) Logical Functions:
a) Show/hide password:

b) Show current status

The result of the above code is:

CU ID: 10174711 24 Student ID: 190261


c) Searching:

The result of the above code is:

CU ID: 10174711 25 Student ID: 190261


iv) Exceptional Handling:

To demonstrate it I misspelled ‘cars’ table to ‘crs’:

The result of the above exception is:

CU ID: 10174711 26 Student ID: 190261


v) Test Classes and report:
The code editor that I am using (VS code) automatically detects test classes and run
the test when instructed. The test class and results are as follows:

CU ID: 10174711 27 Student ID: 190261


vi) Database:
The database to store the data of the system is created using SQL. All the queries
and the result table are shown below:
a) SQL query to create the table Users

b) SQL query to create the table Cars

CU ID: 10174711 28 Student ID: 190261


c) SQL query to create table parking_detail:

d)SQL query to create the table parking:

e) SQL query to create table orders:

CU ID: 10174711 29 Student ID: 190261


f) SQL query to show the username and their parking details

CU ID: 10174711 30 Student ID: 190261


Conclusion:
The system is very interactive and user friendly. The main goal of the system is to let
admin add details of the available cars so that the user can view the details and
choose the available car to rent according to their budget and interest. Besides,
users can also book a parking spot for their vehicles. To make the system visually
appealing functions such as ImageTk, ThemedTk, and tkcalender are used which is
available in python’s library.
There is no chance of data loss as the data of the system is directly saved into the
database, so it's very easy to insert and extract the data in the real-time.
Similarly, Unit testing of the classes is done to check if the function to check if there
exists any error in the code that might interrupt the function of the system.
Furthermore, exceptional handling is performed to prevent the whole system from
crashing if any unexpected error is encountered. In conclusion, the system meets all
the requirements and performs its goal flawlessly.

CU ID: 10174711 31 Student ID: 190261


References:
1. Wiki.tcl-lang.org. 2020. List Of Ttk Themes. [online] Available at: <https://wiki.tcl-
lang.org/page/List+of+ttk+Themes> [Accessed 30 July 2020].

2. Tiwari, G., and Joshi, D., 2020. How Do I Create A Date Picker In Tkinter?. [online] Stack
Overflow. Available at: <https://stackoverflow.com/questions/4443786/how-do-i-create-a-
date-picker-in-tkinter> [Accessed 6 August 2020].

3. W3schools.com. 2020. SQL Joins. [online] Available at:


<https://www.w3schools.com/sql/sql_join.asp> [Accessed 15 August 2020].

4. www.youtube.com. 2020. [online] Available at:


<https://www.youtube.com/watch?v=NoTM8JciWaQ> [Accessed 7 August 2020].
5. www.flaticon.com. 2020. Flaticon. [online] Available at:
<https://www.flaticon.com/search?word=model> [Accessed 7 August 2020].

GitHub link (Source code):


https://github.com/softwarica-github/final-assignment-tsachin34

CU ID: 10174711 32 Student ID: 190261


CU ID: 10174711 33 Student ID: 190261

You might also like