diff --git a/javaCli-carBooking.iml b/javaCli-carBooking.iml new file mode 100644 index 0000000..f76df2b --- /dev/null +++ b/javaCli-carBooking.iml @@ -0,0 +1,11 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/src/main/java/Main.java b/src/main/java/Main.java deleted file mode 100644 index 23a46d3..0000000 --- a/src/main/java/Main.java +++ /dev/null @@ -1,11 +0,0 @@ - -// 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("Java Master Class"); - } -} diff --git a/src/main/java/com/hamza/Main.java b/src/main/java/com/hamza/Main.java new file mode 100644 index 0000000..eca0e09 --- /dev/null +++ b/src/main/java/com/hamza/Main.java @@ -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"); + + } + +} diff --git a/src/main/java/com/hamza/Users/User.java b/src/main/java/com/hamza/Users/User.java new file mode 100644 index 0000000..08fc55c --- /dev/null +++ b/src/main/java/com/hamza/Users/User.java @@ -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); + } +} + diff --git a/src/main/java/com/hamza/Users/UserDAO.java b/src/main/java/com/hamza/Users/UserDAO.java new file mode 100644 index 0000000..d1fa03f --- /dev/null +++ b/src/main/java/com/hamza/Users/UserDAO.java @@ -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; + } +}