Answered step by step
Verified Expert Solution
Question
1 Approved Answer
The Java language uses functions and arrays to solve the following question. (car booking system) Executing the project begins with printing the main menu: 1.Log
The Java language uses functions and arrays to solve the following question.
(car booking system)
Executing the project begins with printing the main menu:
1.Log in as an administrator.
2. Entering as a tenant.
3. Exit.
Login as administrator:
The program asks to enter a username and password
If the user name is not admin and the password is 10002000, an error message is displayed stating that
There is an error in the username or password and the following menu is displayed:
1. Try again.
2. Return to the main menu.
Otherwise, a greeting is displayed and the list of administrators is shown:
A. tenants.
B.Auto.
C.exit.
If operation A is selected, the program displays the following list:
1. Add a tenant.
2. View tenants.
3. Searching for a tenant.
4. Modification of tenant data.
5. Delete a tenant.
If process number 1 is selected, the program requests the following information to be entered:
The name of the tenant
ID Number
the address
The amount of money
If the addition is successful, the following list will be displayed:
1. Repeat the process.
2. Refer to the list of administrators.
If process number 2 is chosen, the program will do the following:
The tenants' data (tenant's name, identity number, address, money amount, and car number) are displayed
that have been rented.
In the event that there are no tenants, a message is printed stating this.
After completing the process, you will be returned to the Administrator menu.
If operation number 3 is selected, the program will do the following:
Request to enter the ID number of the tenant to be searched for.
In the event that this account exists, the tenant's data will be displayed, otherwise a message will be printed stating that it is not
A tenant owns this number.
Display the following list if the operation was successful:
1. Repeat the process.
2. Refer to the list of administrators.
If operation number 4 is selected, the program will do the following:
The ID number is entered.
In the event that this tenant exists, the new data is entered for updating (name, identification number, address,
money amount (
Otherwise, a message will be printed stating that there is no account that owns this number.
Display the following list if the modification process was successful:
1. Repeat the process.
2. Refer to the list of administrators.
If operation number 5 is selected, the program will do the following:
The ID number is entered.
If this tenant exists, it will be deleted, otherwise a message will be printed stating that there is no account owned
this number.
Display the following list if the modification process was successful:
1. Repeat the process.
2. Refer to the list of administrators.
If operation B is selected, the program displays the following menu:
1. Add a car.
2 .auto show.
3. Find a car.
4. Modification of car data.
5. Delete a car.
If process number 1 is selected, the program requests the following information to be entered:
Type of car.
car number.
Quantity Available.
Rental price.
If the addition is successful, the following list will be displayed:
1. Repeat the process.
2. Refer to the list of administrators.
If operation number 2 is selected, the program will do the following:
Available vehicle data is displayed.
In the absence of cars, a message will be printed explaining this.
After completing the process, you will be returned to the Administrator menu.
If operation number 3 is selected, the program will do the following:
Request to enter the vehicle number to be searched for.
If this car exists, the car data will be displayed, otherwise a message stating that it does not exist will be printed
A car that has this number.
Display the following list if the operation was successful:
1. Repeat the process.
2. Refer to the list of administrators.
If operation number 4 is selected, the program will do the following:
The vehicle number is entered.
In the event that this tenant exists, the new data is entered for updating (car type, car number, quantity
available, rental price)
Otherwise, a message will be printed stating that there is no car with this number.
Display the following list if the modification process was successful:
1. Repeat the process.
2. Refer to the list of administrators.
If operation number 5 is selected, the program will do the following:
The vehicle number is entered.
If this car exists, it will be deleted, otherwise a message will be printed stating that there is no car that owns this
the number.
Display the following list if the modification process was successful:
1. Repeat the process.
2. Refer to the list of administrators.
If operation number C is selected, the program will print a leaving message and return to the main menu.
Entering as a tenant:
The program asks for the ID number
If this account exists, the program displays the list of users:
1. Book a car.
2. Returning a car.
3. Exit.
If operation number 1 is selected, the program will print all available vehicle data.
Type of car.
car number.
Quantity Available.
Rental price.
Then the program does the following:
The user is required to enter the car number that he wants to rent
If the amount of money in the user's account is sufficient & the number of cars is available & the user has not booked
The reservation process is completed successfully, otherwise an error message is displayed.
car already
View the following list:
1. Repeat the process.
2. Refer to the list of tenants.
(Warning, when booking any car, the change is made to the available quantity of the car that was booked, as the
The quantity will decrease and the renter can book only one car.)
If operation number 2 is selected, the program will do the following:
The user is required to enter the vehicle number that he wants to return
If the vehicle is present, the return process is successful, otherwise an error message is displayed.
View the following list:
1. Repeat the process.
2. Return to the user list.
(Warning when returning any car, the change is made to the available quantity of the car that was returned, as the
quantity will increase)
If operation number 3 is selected, the program will print a leaving message and return to the main menu.
Exit:
Program termination.
Important notes:
You must use functions and matrices
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started