https://github.com/danijeldragicevic/simple-car-sharing-app
A simple application for managing car rentals
https://github.com/danijeldragicevic/simple-car-sharing-app
dao-design-pattern daos h2-database java-11 javac querystring
Last synced: 3 months ago
JSON representation
A simple application for managing car rentals
- Host: GitHub
- URL: https://github.com/danijeldragicevic/simple-car-sharing-app
- Owner: danijeldragicevic
- License: apache-2.0
- Created: 2023-04-28T12:32:21.000Z (about 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-28T12:34:24.000Z (about 2 years ago)
- Last Synced: 2025-01-30T12:14:24.339Z (5 months ago)
- Topics: dao-design-pattern, daos, h2-database, java-11, javac, querystring
- Language: Java
- Homepage:
- Size: 2.28 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Simple Car Sharing App
Java application who manages car renting(s).
Application is able to:
- create cars, companies and customers;
- customers are able to rent and return cars to belonging companies;# Technology
- Java 11
- H2 database# To run application:
There are no any build automation tool used. We have to compile and run manually. :)To compile files, navigate to the project root directory and run following command:
> javac -cp ./libs/h2-2.1.214.jar -d ./out/production/simple-car-sharing-app -sourcepath . src/carsharing/*.java src/carsharing/*/*.java src/carsharing/*/*/*.javaTo run application, navigate to the project root directory and run following command:
> java -cp ./libs/h2-2.1.214.jar:./out/production/simple-car-sharing-app carsharing.Main# Examples
The symbol **>** represents the user input.**Example 1:** Manager operations:
```
1. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
>11. Company list
2. Create a company
0. Back
>1
The company list is empty!1. Company list
2. Create a company
0. Back
>2Enter the company name:
Car ToGo
The company was created.1. Company list
2. Create a company
0. Back
> 2Enter the company name:
Drive Now
The company was created.1. Company list
2. Create a company
0. Back
> 1Choose the company:
1. Car ToGo
2. Drive Now
0. Back
```**Example 2:** Company operations:
```
Choose the company:
1. Car ToGo
2. Drive Now
0. Back
> 1'Car ToGo' company
1. Car list
2. Create a car
0. Back
> 1The car list is empty!
'Car ToGo' company
1. Car list
2. Create a car
0. Back
> 2Enter the car name:
Ford Mustang
The car was created.'Car ToGo' company
1. Car list
2. Create a car
0. Back
> 2Enter the car name:
Dodge Viper
The car was created.'Car ToGo' company
1. Car list
2. Create a car
0. Back
> 1Car list:
1. Ford Mustang rented: false
2. Dodge Viper rented: false'Car ToGo' company
1. Car list
2. Create a car
0. Back
> 01. Company list
2. Create a company
0. Back
> 01. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
```**Example 3:** Customer operations:
```
1. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
> 2
The customer list is empty!1. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
> 3Enter the customer name:
John Doe
The customer was created.1. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
> 3Enter the customer name:
Jane Doe
The customer was created.1. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
> 2Choose a customer:
1. John Doe
2. Jane Doe
0. Back
> 21. Rent a car
2. Return a rented car
3. My rented car
0. Back
> 1Choose a company:
1. Car ToGo
2. Drive Now
0. Back
> 1Choose a car:
1. Ford Mustang
2. Dodge Viper
> 1
You rented 'Ford Mustang'1. Rent a car
2. Return a rented car
3. My rented car
0. Back
> 1
You've already rented a car!1. Rent a car
2. Return a rented car
3. My rented car
0. Back
> 3
Your rented car:
Ford Mustang
Company:
Car ToGo1. Rent a car
2. Return a rented car
3. My rented car
0. Back
> 2
You've returned a rented car: Ford Mustang.1. Rent a car
2. Return a rented car
3. My rented car
0. Back
> 01. Log in as a manager
2. Log in as a customer
3. Create a customer
0. Exit
> 0
```# Licence
[](https://opensource.org/licenses/Apache-2.0)