Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions javaCli-carBooking.iml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<module type="JAVA_MODULE" version="4">
<component name="NewModuleRootManager" inherit-compiler-output="true">
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/src/main/java" isTestSource="false" />
</content>
<orderEntry type="inheritedJdk" />
<orderEntry type="sourceFolder" forTests="false" />
</component>
</module>
11 changes: 0 additions & 11 deletions src/main/java/Main.java

This file was deleted.

22 changes: 22 additions & 0 deletions src/main/java/com/hamza/Main.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.hamza;
// TODO 1. create a new branch called initial-implementation
// TODO 2. create a package with your name. i.e com.franco and move this file inside the new package
// TODO 3. implement https://amigoscode.com/learn/java-cli-build/lectures/3a83ecf3-e837-4ae5-85a8-f8ae3f60f7f5

public class Main {

public static void main(String[] args) {

System.out.println("Hi! Welcome to your car booking app. ");
System.out.println("Please select one of the options to get started: ");
System.out.println("1\uFE0F⃣ - Book Car");
System.out.println("2\uFE0F⃣ - View All User Booked Cars");
System.out.println("3\uFE0F⃣ - View All Bookings");
System.out.println("4\uFE0F⃣ - View Available Cars");
System.out.println("5\uFE0F⃣ - View Available Electric Cars");
System.out.println("6\uFE0F⃣ - View all users");
System.out.println("7\uFE0F⃣ - Exit");

}

}
42 changes: 42 additions & 0 deletions src/main/java/com/hamza/Users/User.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package com.hamza.Users;

import java.util.Objects;

public class User {
private String userID;
private String name;

public User(String userID, String name) {
this.userID = userID;
this.name = name;
}

public String getUserID() {
return userID;
}

public void setUserID(String userID) {
this.userID = userID;
}

public String getName() {
return name;
}

public void setName(String name) {
this.name = name;
}

@Override
public boolean equals(Object o) {
if (o == null || getClass() != o.getClass()) return false;
User user = (User) o;
return Objects.equals(userID, user.userID) && Objects.equals(name, user.name);
}

@Override
public int hashCode() {
return Objects.hash(userID, name);
}
}

25 changes: 25 additions & 0 deletions src/main/java/com/hamza/Users/UserDAO.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
package com.hamza.Users;

public class UserDAO {

private static final User[] userList;

static {
userList = new User[]{
new User("f41c329c-a1ad-4a06-9fdc-695c7e9cb830", "Montana"),
new User("a930642e-e717-48df-99c5-bde3766ff0a4", "Austin"),
new User("f41c329c-a1ad-4a06-9fdc-695c7e9cb830", "Wilmington"),
new User("87994382-6bff-460e-9f1d-57410415e94c", "Trevor"),
new User("fe9d0e1a-2abe-4918-8278-cd1663d4b470", "Tony"),
new User("ab0edfce-e78f-4419-9ae9-b930e1e38856", "Malcolm X"),
new User("d76d1e3a-03c0-4439-a4c8-b72add46c629", "Ebenezer"),
new User("1bfc0468-b666-4176-875c-2d281d6056a8", "Francis"),
new User("3c7536c2-0092-4786-b9e6-313d221a4eeb", "Agustus"),
new User("7a814e87-d7a0-4973-b950-6f4caa83e3bc", "Sherlock")
};
}

public User[] getUsers(){
return userList;
}
}