From 0bf3e90903f15e6410e1a91a2a791748dd7276d1 Mon Sep 17 00:00:00 2001 From: hosein Date: Fri, 19 May 2023 22:30:19 +0430 Subject: [PATCH 1/2] git init --- RentalProject/.idea/.gitignore | 3 + RentalProject/.idea/compiler.xml | 13 + RentalProject/.idea/encodings.xml | 7 + RentalProject/.idea/jarRepositories.xml | 20 + RentalProject/.idea/misc.xml | 14 + RentalProject/pom.xml | 23 + .../src/main/java/org/example/AllModules.java | 42 ++ .../src/main/java/org/example/Book.java | 37 ++ .../src/main/java/org/example/Customer.java | 45 ++ .../src/main/java/org/example/Game.java | 41 ++ .../src/main/java/org/example/Item.java | 44 ++ .../src/main/java/org/example/Main.java | 54 +++ .../src/main/java/org/example/Movie.java | 36 ++ .../src/main/java/org/example/Person.java | 33 ++ .../src/main/java/org/example/Rental.java | 47 ++ .../main/java/org/example/RentalStore.java | 72 ++++ RentalProject/src/test/TestYourFork.json | 406 ++++++++++++++++++ .../classes/org/example/AllModules.class | Bin 0 -> 1879 bytes .../target/classes/org/example/Book.class | Bin 0 -> 1209 bytes .../target/classes/org/example/Customer.class | Bin 0 -> 1486 bytes .../target/classes/org/example/Game.class | Bin 0 -> 1253 bytes .../target/classes/org/example/Item.class | Bin 0 -> 1121 bytes .../target/classes/org/example/Main$1.class | Bin 0 -> 503 bytes .../target/classes/org/example/Main.class | Bin 0 -> 2700 bytes .../target/classes/org/example/Movie.class | Bin 0 -> 1131 bytes .../target/classes/org/example/Person.class | Bin 0 -> 898 bytes .../target/classes/org/example/Rental.class | Bin 0 -> 1318 bytes .../classes/org/example/RentalStore.class | Bin 0 -> 2599 bytes 28 files changed, 937 insertions(+) create mode 100644 RentalProject/.idea/.gitignore create mode 100644 RentalProject/.idea/compiler.xml create mode 100644 RentalProject/.idea/encodings.xml create mode 100644 RentalProject/.idea/jarRepositories.xml create mode 100644 RentalProject/.idea/misc.xml create mode 100644 RentalProject/pom.xml create mode 100644 RentalProject/src/main/java/org/example/AllModules.java create mode 100644 RentalProject/src/main/java/org/example/Book.java create mode 100644 RentalProject/src/main/java/org/example/Customer.java create mode 100644 RentalProject/src/main/java/org/example/Game.java create mode 100644 RentalProject/src/main/java/org/example/Item.java create mode 100644 RentalProject/src/main/java/org/example/Main.java create mode 100644 RentalProject/src/main/java/org/example/Movie.java create mode 100644 RentalProject/src/main/java/org/example/Person.java create mode 100644 RentalProject/src/main/java/org/example/Rental.java create mode 100644 RentalProject/src/main/java/org/example/RentalStore.java create mode 100644 RentalProject/src/test/TestYourFork.json create mode 100644 RentalProject/target/classes/org/example/AllModules.class create mode 100644 RentalProject/target/classes/org/example/Book.class create mode 100644 RentalProject/target/classes/org/example/Customer.class create mode 100644 RentalProject/target/classes/org/example/Game.class create mode 100644 RentalProject/target/classes/org/example/Item.class create mode 100644 RentalProject/target/classes/org/example/Main$1.class create mode 100644 RentalProject/target/classes/org/example/Main.class create mode 100644 RentalProject/target/classes/org/example/Movie.class create mode 100644 RentalProject/target/classes/org/example/Person.class create mode 100644 RentalProject/target/classes/org/example/Rental.class create mode 100644 RentalProject/target/classes/org/example/RentalStore.class diff --git a/RentalProject/.idea/.gitignore b/RentalProject/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/RentalProject/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/RentalProject/.idea/compiler.xml b/RentalProject/.idea/compiler.xml new file mode 100644 index 0000000..2376ecc --- /dev/null +++ b/RentalProject/.idea/compiler.xml @@ -0,0 +1,13 @@ + + + + + + + + + + + + + \ No newline at end of file diff --git a/RentalProject/.idea/encodings.xml b/RentalProject/.idea/encodings.xml new file mode 100644 index 0000000..aa00ffa --- /dev/null +++ b/RentalProject/.idea/encodings.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/RentalProject/.idea/jarRepositories.xml b/RentalProject/.idea/jarRepositories.xml new file mode 100644 index 0000000..712ab9d --- /dev/null +++ b/RentalProject/.idea/jarRepositories.xml @@ -0,0 +1,20 @@ + + + + + + + + + + + \ No newline at end of file diff --git a/RentalProject/.idea/misc.xml b/RentalProject/.idea/misc.xml new file mode 100644 index 0000000..e5d6295 --- /dev/null +++ b/RentalProject/.idea/misc.xml @@ -0,0 +1,14 @@ + + + + + + + + + + \ No newline at end of file diff --git a/RentalProject/pom.xml b/RentalProject/pom.xml new file mode 100644 index 0000000..864992d --- /dev/null +++ b/RentalProject/pom.xml @@ -0,0 +1,23 @@ + + + 4.0.0 + + org.example + untitled9 + 1.0-SNAPSHOT + + 19 + 19 + UTF-8 + + + + com.google.code.gson + gson + 2.10.1 + + + + diff --git a/RentalProject/src/main/java/org/example/AllModules.java b/RentalProject/src/main/java/org/example/AllModules.java new file mode 100644 index 0000000..17e0ce0 --- /dev/null +++ b/RentalProject/src/main/java/org/example/AllModules.java @@ -0,0 +1,42 @@ +package org.example; + +import java.util.ArrayList; + +public class AllModules { + public ArrayList games; + public ArrayList books; + public ArrayList movies; + public ArrayList customers; + + public ArrayList getGames() { + return games; + } + + public ArrayList getBooks() { + return books; + } + + public ArrayList getMovies() { + return movies; + } + + public ArrayList getCustomers() { + return customers; + } + + public void setGames(ArrayList games) { + this.games = games; + } + + public void setBooks(ArrayList books) { + this.books = books; + } + + public void setMovies(ArrayList movies) { + this.movies = movies; + } + + public void setCustomers(ArrayList customers) { + this.customers = customers; + } +} diff --git a/RentalProject/src/main/java/org/example/Book.java b/RentalProject/src/main/java/org/example/Book.java new file mode 100644 index 0000000..f88d7a3 --- /dev/null +++ b/RentalProject/src/main/java/org/example/Book.java @@ -0,0 +1,37 @@ +package org.example; + +import java.util.Date; + +public class Book extends Item { + String writer; + String publisher; + String bookCover; + + public Book(String title, String genre, String writer, Date releaseDate,String publisher,String bookCover, int id,boolean isAvailable ) { + super(title, genre, releaseDate, id,isAvailable); + this.writer = writer; + this.publisher=publisher; + this.bookCover=bookCover; + } + + public String getTitle() { + return getName(); + } + + public String getGenre() { + return genre; + } + + public String getAuthor() { + return writer; + } + + public Date getReleaseDate() { + return releaseDate; + } + + public int getID() { + return returnId(); + } + +} diff --git a/RentalProject/src/main/java/org/example/Customer.java b/RentalProject/src/main/java/org/example/Customer.java new file mode 100644 index 0000000..ddb8bcc --- /dev/null +++ b/RentalProject/src/main/java/org/example/Customer.java @@ -0,0 +1,45 @@ +package org.example; + +import java.util.ArrayList; +import java.util.List; + +public class Customer { + int id; + String name; + String email; + String phone; + String address; + List rentals=new ArrayList<>(); + + public Customer(String name, String email, String phone, String address, int id, List rentals) { + this.id = id; + this.name = name; + this.email = email; + this.phone = phone; + this.address = address; + } + + public int getId() { + return id; + } + + public String getName() { + return name; + } + + public String getEmail() { + return email; + } + + public String getPhone() { + return phone; + } + + public List getRentals() { + return rentals; + } + + public String getAddress() { + return address; + } +} diff --git a/RentalProject/src/main/java/org/example/Game.java b/RentalProject/src/main/java/org/example/Game.java new file mode 100644 index 0000000..498700f --- /dev/null +++ b/RentalProject/src/main/java/org/example/Game.java @@ -0,0 +1,41 @@ +package org.example; + +import java.util.Date; +// "gameRate": 9, +// "aboutGame": "Embark on an epic adventure as Link", +// "manufacturer": "Nintendo" +public class Game extends Item { + String company; + String aboutGame; + String director; + double gameRate; + + public Game(String title, String genre, String company, Date releaseDate, int id,boolean isAvailable,String aboutGame,String director,double gameRate) { + super(title, genre, releaseDate, id,isAvailable); + this.company = company; + this.aboutGame=aboutGame; + this.director=director; + this.gameRate=gameRate; + } + + public String getName() { + return title; + } + + public String getCompany() { + return company; + } + + public String getGenre() { + return genre; + } + + public Date getReleaseDate() { + return releaseDate; + } + + public int getId() { + return returnId(); + } + +} diff --git a/RentalProject/src/main/java/org/example/Item.java b/RentalProject/src/main/java/org/example/Item.java new file mode 100644 index 0000000..20f6f71 --- /dev/null +++ b/RentalProject/src/main/java/org/example/Item.java @@ -0,0 +1,44 @@ +package org.example; + +import java.util.Date; + +public class Item { + int id; + String title; + String genre; + Date releaseDate; + boolean isAvailable; + + public String getName() { + return title; + } + + public String getGenre() { + return genre; + } + + public Date getReleasedate() { + return releaseDate; + } + + public Item(String name, String genre, Date releaseDate, int id,boolean isAvailable) { + this.id = id; + this.title = name; + this.genre = genre; + this.releaseDate = releaseDate; + this.isAvailable=isAvailable; + } + + public void setAvailable() { + isAvailable = true; + return; + } + + public boolean isavailable() { + return isAvailable; + } + + public int returnId() { + return id; + } +} diff --git a/RentalProject/src/main/java/org/example/Main.java b/RentalProject/src/main/java/org/example/Main.java new file mode 100644 index 0000000..220181a --- /dev/null +++ b/RentalProject/src/main/java/org/example/Main.java @@ -0,0 +1,54 @@ +package org.example; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.io.*; +import java.io.FileWriter; +import java.util.List; + +public class Main { + public static void main(String[] args) throws IOException { + Gson gson = new Gson(); + Reader reader = new FileReader("C:\\Users\\NS\\IdeaProjects\\untitled9\\src\\test\\TestYourFork.json"); + AllModules allModules = gson.fromJson(reader, new TypeToken() { + }.getType()); + + Customer Joshn = allModules.getCustomers().get(0); + Customer Emily = allModules.getCustomers().get(1); + Customer Brown = allModules.getCustomers().get(2); + + for (Item tempItem : allModules.getBooks()) { + if (tempItem.id == 3) RentalStore.rentItem(tempItem, Joshn); + else if (tempItem.id == 6) { + RentalStore.rentItem(tempItem, Joshn); + } + } + + for (Item tempItem : allModules.getBooks()) { + if (tempItem.id == 1) RentalStore.rentItem(tempItem, Emily); + else if (tempItem.id == 7) { + RentalStore.rentItem(tempItem, Emily); + } + } + + for (Item tempItem : allModules.getBooks()) { + if (tempItem.id == 9) RentalStore.rentItem(tempItem, Brown); + else if (tempItem.id == 4) { + RentalStore.rentItem(tempItem, Brown); + } + } + reader.close(); + Gson gson1 = new Gson(); + String json = gson1.toJson(allModules); + String filePath = "C:\\Users\\NS\\IdeaProjects\\untitled9\\src\\test\\TestYourFork.json"; + try { + java.io.FileWriter writer = new FileWriter(filePath); + writer.write(json); + writer.close(); + System.out.println("JSON data has been written to the file successfully."); + } catch (IOException e) { + e.printStackTrace(); + } + } +} diff --git a/RentalProject/src/main/java/org/example/Movie.java b/RentalProject/src/main/java/org/example/Movie.java new file mode 100644 index 0000000..a9fa9f1 --- /dev/null +++ b/RentalProject/src/main/java/org/example/Movie.java @@ -0,0 +1,36 @@ +package org.example; + +import java.util.Date; + +public class Movie extends Item { + String director; + String cast; + + public Movie(String title, String genre, String director, String cast, Date releaseDate, int ID,boolean isAvailable) { + super(title, genre, releaseDate,ID,isAvailable); + this.genre = genre; + this.director = director; + this.cast = cast; + } + + + public String getGenre() { + return genre; + } + + public String getDirector() { + return director; + } + + public String getCast() { + return cast; + } + + public Date getReleaseDate() { + return releaseDate; + } + + public int getID() { + return returnId(); + } +} diff --git a/RentalProject/src/main/java/org/example/Person.java b/RentalProject/src/main/java/org/example/Person.java new file mode 100644 index 0000000..252e483 --- /dev/null +++ b/RentalProject/src/main/java/org/example/Person.java @@ -0,0 +1,33 @@ +package org.example; + +import com.google.gson.Gson; +import com.google.gson.reflect.TypeToken; + +import java.io.*; +import java.util.List; + +public class Person { + private String name; + private int age; + private String email; + public String getName() { + return name; + } + public void setName(String name) { + this.name = name; + } + public int getAge() { + return age; + } + public void setAge(int age) { + this.age = age; + } + public String getEmail() { + return email; + } + public void setEmail(String email) { + this.email = email; + } + + +} diff --git a/RentalProject/src/main/java/org/example/Rental.java b/RentalProject/src/main/java/org/example/Rental.java new file mode 100644 index 0000000..847293d --- /dev/null +++ b/RentalProject/src/main/java/org/example/Rental.java @@ -0,0 +1,47 @@ +package org.example; + +import java.util.Date; + +public class Rental { + int id; + Item item; + Customer customer; + Date rentalDate; + Date returnDate; + + public Rental(Item item, Customer customer) { + this.id = customer.id + item.id; + this.item = item; + this.customer=customer; + item.isAvailable=false; + } + + public int getId() { + return id; + } + + + public Item getitem() { + return item; + } + + public Customer getCustomer() { + return customer; + } + + public Date getRentalDate() { + return rentalDate; + } + + public Date getReturnDate() { + return returnDate; + } + + public void setReturnDate(Date returnDate) { + this.returnDate = returnDate; + } + + public double calculateLateFee() { + return 0; + } +} diff --git a/RentalProject/src/main/java/org/example/RentalStore.java b/RentalProject/src/main/java/org/example/RentalStore.java new file mode 100644 index 0000000..0d50c81 --- /dev/null +++ b/RentalProject/src/main/java/org/example/RentalStore.java @@ -0,0 +1,72 @@ +package org.example; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class RentalStore { + List items; + + List customers; + + public void Register(Customer customer) { + customers.add(customer); + } + + public void addItem(Item item) { + items.add(item); + } + + public void removeItem(Item item) { + items.remove(item); + } + + public List getAvailableItem() { + List availableList = null; + for (Item i : items) { + if (i.isavailable()) { + availableList.add(i); + } + } + return availableList; + } + + public static void rentItem(Item item, Customer customer) { + Rental rental = new Rental(item, customer); + rental.rentalDate = new Date(); + System.out.println(); + if (customer.rentals == null) { + customer.rentals = new ArrayList<>(); + } + customer.rentals.add(rental); + + } + + public static void returnItem(Rental rental) { + rental.rentalDate = new Date(); + rental.item.setAvailable(); + return; + } + + + public Customer getCustomerById(int id) { + for (Customer i : + customers) { + if (id == i.id) { + return i; + } + } + return null; + } + + public Item getItemById(int id) { + for (Item i : + items) { + if (id == i.returnId()) { + return i; + } + } + return null; + } +} + diff --git a/RentalProject/src/test/TestYourFork.json b/RentalProject/src/test/TestYourFork.json new file mode 100644 index 0000000..6ace936 --- /dev/null +++ b/RentalProject/src/test/TestYourFork.json @@ -0,0 +1,406 @@ +{ + "games": [ + { + "company": "Nintendo", + "aboutGame": "Embark on an epic adventure as Link", + "director": "Shigeru Miyamoto", + "gameRate": 9.0, + "id": 1, + "title": "The Legend of Zelda: Breath of the Wild", + "genre": "Action-Adventure", + "releaseDate": "Mar 3, 2017, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Rockstar Games", + "aboutGame": "Experience life in the Wild West", + "director": "Dan Houser", + "gameRate": 9.5, + "id": 2, + "title": "Red Dead Redemption 2", + "genre": "Action-Adventure", + "releaseDate": "Oct 26, 2018, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "CD Projekt", + "aboutGame": "Embark on a monster-hunting adventure as Geralt of Rivia", + "director": "Konrad Tomaszkiewicz", + "gameRate": 9.8, + "id": 3, + "title": "The Witcher 3: Wild Hunt", + "genre": "Action-RPG", + "releaseDate": "May 19, 2015, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Nintendo", + "aboutGame": "Join Mario on a globe-trotting journey to rescue Princess Peach", + "director": "Kenta Motokura", + "gameRate": 9.3, + "id": 4, + "title": "Super Mario Odyssey", + "genre": "Platformer", + "releaseDate": "Oct 27, 2017, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Santa Monica Studio", + "aboutGame": "Experience the epic adventures of Kratos and Atreus", + "director": "Cory Barlog", + "gameRate": 9.7, + "id": 5, + "title": "God of War (2018)", + "genre": "Action-Adventure", + "releaseDate": "Apr 20, 2018, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Rockstar Games", + "aboutGame": "Explore the open world of Los Santos in this crime-filled saga", + "director": "Aaron Garbut", + "gameRate": 9.6, + "id": 6, + "title": "Grand Theft Auto V", + "genre": "Action-Adventure", + "releaseDate": "Sep 17, 2013, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Mojang Studios", + "aboutGame": "Build and explore your own virtual world", + "director": "Markus Persson", + "gameRate": 6.3, + "id": 7, + "title": "Minecraft", + "genre": "Sandbox", + "releaseDate": "Nov 18, 2011, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Naughty Dog", + "aboutGame": "Survive in a post-apocalyptic world filled with infected creatures", + "director": "Neil Druckmann", + "gameRate": 9.7, + "id": 8, + "title": "The Last of Us Part II", + "genre": "Action-Adventure", + "releaseDate": "Jun 19, 2020, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Bethesda Game Studios", + "aboutGame": "Navigate the wasteland and make choices that shape the future", + "director": "Todd Howard", + "gameRate": 9.2, + "id": 9, + "title": "Fallout 4", + "genre": "Action-RPG", + "releaseDate": "Nov 10, 2015, 12:00:00 AM", + "isAvailable": true + }, + { + "company": "Ubisoft Montreal", + "aboutGame": "Embark on a Viking adventure in the age of the Dark Ages", + "director": "Ashraf Ismail", + "gameRate": 9.1, + "id": 10, + "title": "Assassin\u0027s Creed Valhalla", + "genre": "Action-Adventure", + "releaseDate": "Nov 10, 2020, 12:00:00 AM", + "isAvailable": true + } + ], + "books": [ + { + "writer": "Alice Thompson", + "publisher": "Penguin Books", + "bookCover": "https://example.com/book1.jpg", + "id": 1, + "title": "The Secret Garden", + "genre": "Fiction", + "releaseDate": "Mar 15, 2022, 12:00:00 AM", + "isAvailable": false + }, + { + "writer": "Benjamin Martin", + "publisher": "HarperCollins", + "bookCover": "https://example.com/book2.jpg", + "id": 2, + "title": "The Alchemist", + "genre": "Fantasy", + "releaseDate": "Jul 1, 2021, 12:00:00 AM", + "isAvailable": true + }, + { + "writer": "Jane Austen", + "publisher": "Thomas Egerton", + "bookCover": "https://example.com/book3.jpg", + "id": 3, + "title": "Pride and Prejudice", + "genre": "Romance", + "releaseDate": "Jan 28, 1813, 12:00:00 AM", + "isAvailable": false + }, + { + "writer": "Harper Lee", + "publisher": "J. B. Lippincott \u0026 Co.", + "bookCover": "https://example.com/book4.jpg", + "id": 4, + "title": "To Kill a Mockingbird", + "genre": "Classic", + "releaseDate": "Jul 11, 1960, 12:00:00 AM", + "isAvailable": false + }, + { + "writer": "George Orwell", + "publisher": "Secker \u0026 Warburg", + "bookCover": "https://example.com/book5.jpg", + "id": 5, + "title": "1984", + "genre": "Dystopian", + "releaseDate": "Jun 8, 1949, 12:00:00 AM", + "isAvailable": true + }, + { + "writer": "F. Scott Fitzgerald", + "publisher": "Charles Scribner\u0027s Sons", + "bookCover": "https://example.com/book6.jpg", + "id": 6, + "title": "The Great Gatsby", + "genre": "Fiction", + "releaseDate": "Apr 10, 1925, 12:00:00 AM", + "isAvailable": false + }, + { + "writer": "J.K. Rowling", + "publisher": "Bloomsbury Publishing", + "bookCover": "https://example.com/book7.jpg", + "id": 7, + "title": "Harry Potter and the Philosopher\u0027s Stone", + "genre": "Fantasy", + "releaseDate": "Jun 26, 1997, 12:00:00 AM", + "isAvailable": false + }, + { + "writer": "J.R.R. Tolkien", + "publisher": "George Allen \u0026 Unwin", + "bookCover": "https://example.com/book8.jpg", + "id": 8, + "title": "The Hobbit", + "genre": "Fantasy", + "releaseDate": "Sep 21, 1937, 12:00:00 AM", + "isAvailable": true + }, + { + "writer": "J.D. Salinger", + "publisher": "Little, Brown and Company", + "bookCover": "https://example.com/book9.jpg", + "id": 9, + "title": "The Catcher in the Rye", + "genre": "Coming-of-age", + "releaseDate": "Jul 16, 1951, 12:00:00 AM", + "isAvailable": false + }, + { + "writer": "C.S. Lewis", + "publisher": "Geoffrey Bles", + "bookCover": "https://example.com/book10.jpg", + "id": 10, + "title": "The Chronicles of Narnia: The Lion, the Witch, and the Wardrobe", + "genre": "Fantasy", + "releaseDate": "Oct 16, 1950, 12:00:00 AM", + "isAvailable": true + } + ], + "movies": [ + { + "director": "Christopher Nolan", + "cast": "Leonardo DiCaprio, Joseph Gordon-Levitt", + "id": 1, + "title": "Inception", + "genre": "Sci-Fi", + "releaseDate": "Jul 16, 2010, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Frank Darabont", + "cast": "Tim Robbins, Morgan Freeman", + "id": 2, + "title": "The Shawshank Redemption", + "genre": "Drama", + "releaseDate": "Sep 23, 1994, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Christopher Nolan", + "cast": "Christian Bale, Heath Ledger", + "id": 3, + "title": "The Dark Knight", + "genre": "Action", + "releaseDate": "Jul 18, 2008, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Quentin Tarantino", + "cast": "John Travolta, Uma Thurman", + "id": 4, + "title": "Pulp Fiction", + "genre": "Crime", + "releaseDate": "Oct 14, 1994, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Francis Ford Coppola", + "cast": "Marlon Brando, Al Pacino", + "id": 5, + "title": "The Godfather", + "genre": "Crime", + "releaseDate": "Mar 24, 1972, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "David Fincher", + "cast": "Brad Pitt, Edward Norton", + "id": 6, + "title": "Fight Club", + "genre": "Drama", + "releaseDate": "Oct 15, 1999, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Lana Wachowski, Lilly Wachowski", + "cast": "Keanu Reeves, Laurence Fishburne", + "id": 7, + "title": "The Matrix", + "genre": "Sci-Fi", + "releaseDate": "Mar 31, 1999, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Robert Zemeckis", + "cast": "Tom Hanks, Robin Wright", + "id": 8, + "title": "Forrest Gump", + "genre": "Drama", + "releaseDate": "Jul 6, 1994, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Peter Jackson", + "cast": "Elijah Wood, Ian McKellen", + "id": 9, + "title": "The Lord of the Rings: The Fellowship of the Ring", + "genre": "Fantasy", + "releaseDate": "Dec 19, 2001, 12:00:00 AM", + "isAvailable": true + }, + { + "director": "Joss Whedon", + "cast": "Robert Downey Jr., Chris Evans", + "id": 10, + "title": "The Avengers", + "genre": "Action", + "releaseDate": "Apr 11, 2012, 12:00:00 AM", + "isAvailable": true + } + ], + "customers": [ + { + "id": 1, + "name": "John Smith", + "email": "johnsmith@example.com", + "phone": "1234567890", + "address": "123 Main Street", + "rentals": [] + }, + { + "id": 4, + "item": { + "id": 3, + "title": "Pride and Prejudice", + "genre": "Romance", + "releaseDate": "Jan 28, 1813, 12:00:00 AM", + "isAvailable": false + }, + "customer": { + "id": 1, + "name": "John Smith", + "email": "johnsmith@example.com", + "phone": "1234567890", + "address": "123 Main Street", + "rentals": [] + }, + "rentalDate": "May 19, 2023, 8:36:51 PM" + }, + { + "id": 7, + "item": { + "id": 6, + "title": "The Great Gatsby", + "genre": "Fiction", + "releaseDate": "Apr 10, 1925, 12:00:00 AM", + "isAvailable": false + }, + "customer": { + "id": 1, + "name": "John Smith", + "email": "johnsmith@example.com", + "phone": "1234567890", + "address": "123 Main Street", + "rentals": [] + }, + "rentalDate": "May 19, 2023, 8:36:51 PM" + }, + { + "id": 4, + "item": { + "id": 3, + "title": "Pride and Prejudice", + "genre": "Romance", + "releaseDate": "Jan 28, 1813, 12:00:00 AM", + "isAvailable": false + }, + "customer": { + "id": 1, + "name": "John Smith", + "email": "johnsmith@example.com", + "phone": "1234567890", + "address": "123 Main Street", + "rentals": [] + }, + "rentalDate": "May 19, 2023, 8:39:58 PM" + }, + { + "id": 7, + "item": { + "id": 6, + "title": "The Great Gatsby", + "genre": "Fiction", + "releaseDate": "Apr 10, 1925, 12:00:00 AM", + "isAvailable": false + }, + "customer": { + "id": 1, + "name": "John Smith", + "email": "johnsmith@example.com", + "phone": "1234567890", + "address": "123 Main Street", + "rentals": [] + }, + "rentalDate": "May 19, 2023, 8:39:58 PM" + }, + { + "id": 4, + "item": { + "id": 3, + "title": "Pride and Prejudice", + "genre": "Romance" + } + } + ] +} + + + + diff --git a/RentalProject/target/classes/org/example/AllModules.class b/RentalProject/target/classes/org/example/AllModules.class new file mode 100644 index 0000000000000000000000000000000000000000..3c45d3c3483b8e822e14691dbb7e8446ef213f8e GIT binary patch literal 1879 zcma)6+iuf95FO|4;F6FwX(*Sr&_b?txjm&SDwW_R1*D?9JE;|1oVarAivATyAS536 z06q$F#+M|u)~a82XJ_Y}Gkd)2zyE&!A)?pxsz@nH=P9F5mU0r6&$UZUHMQwj{V+V& zM~+0f17m79hZ3b5&4Ek>lJitl=oTpw)hv6g>R+|Vg{iAYrg>tWxu!moC_C0BJXiZ3 zq3al?dSu($Ro|F7J!ZMBP>CtBL(BRyJ8C1=`{zqve!+%x(JQ#2r)u~ zn1|H@i;^G%hZrdX8G6)BAR1c4SOwVd&@gE~0X!^+N6b(>wOo6ozcu*Al@=Fij~^;+ z;~l2(XULGmFC1eHs}!vx!gHOk>xl4J=j*$O@KWdN4U!S#mxA#g7*xy>=4|U1N#8xn z`xto}NqT^h!5lxNP0SK)p_xYv`*#XI}kfaak|wnRPd;Mi50z`Re^Q8dYgPr5U5*U+iU-Ds9YFo+EkzH&gWTKaXf@8~^|S literal 0 HcmV?d00001 diff --git a/RentalProject/target/classes/org/example/Book.class b/RentalProject/target/classes/org/example/Book.class new file mode 100644 index 0000000000000000000000000000000000000000..9b7ba9e84d5e625bfd758c30ee52eff8d3d0390f GIT binary patch literal 1209 zcmb7C$!-%t5Pj`!yiAw+@Fa^E;uaD%l1K?G_`2iBk8bbG zlTOpfoMQeH;Ayq>&KM=WWb0G;=m=duq^?nzM^G3PH9_B)k4d>MUiKY!p!vusYK0 zyFDqeRINqRUbRtXf@DYbwPea`Hm+k;Ag84#-GO8eq&S36TydQnHf~}~Ag!et>VET7 zAYQFC1^oYL)NC^+MP@b6X1KiqiCzDcWX`u#U+xckZK)64wnv#l%Rh0wBUdZFUnCQz zs|LY;mxj%AXiz7NG7O9F*Hrtud^6IXT8$y__0j;VZp};Wm9sgbkT(EMgAJ$YYf% z+@b8-kO_Bjk8Z??DpeFgL>m+6ssyT7U4?fBi6CNy%v<5rBt;z6P=^&n8`vaQ0$Wr) zRPE5oyvh1ET=_ylD2}axC|FEbIC&vPU^@bQj^$}^DH7~Nf~{%rN+kF`9?Zx-$I3Lg X5($1t6P@*3`8?%$JrevVc=h-X8~WCa literal 0 HcmV?d00001 diff --git a/RentalProject/target/classes/org/example/Customer.class b/RentalProject/target/classes/org/example/Customer.class new file mode 100644 index 0000000000000000000000000000000000000000..bcf8d68906fe48987d38160ac9856d5809d6ca62 GIT binary patch literal 1486 zcmcIjT~8BH5Iwi;cA+j%pnQpnd4x+zPxTe966`AdzWbw$=iasvm*vI8hu%9ooilUJ%-o;9zJ3Sr6i;$UA#EaK!9Z3ZeiS#h8!7?#oVH9Hmg;v;b z+z+yO>buTvryaGLZYW@eZV*Yo&1$tjnN*UBN-%C=0+RwMuPz{}$~9$S8Z!c!KsH^0 zi5^U|+>b&pXlUS^h3hKHaGTQe74C+Go7!`F+zMRfS+H#OwF@rzEXn}$kE#y2Zc`zka{Ea9tjjLIj`W&kbTMzwWxBZanc->N;kkq%o}+KAGZqDEOi+m~h2 zSH?O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 HcmV?d00001 diff --git a/RentalProject/target/classes/org/example/Main$1.class b/RentalProject/target/classes/org/example/Main$1.class new file mode 100644 index 0000000000000000000000000000000000000000..ffefc7e7cd51b4fc367f5b0ee2e99695ca1aec2e GIT binary patch literal 503 zcmah_O-}+b5PjuqVO<3Q@#Cb42k_v=Gl(%nqshVr!o^cr>QXH&*)B$ZmM0Sr{s4cJ zaTdL(2Pf&g&g;C%>%4!wz5zJHo{J2!4sssyC@>s^X6{GEL`wLPHQJBGtrB74kDeA{ zWbTD#D0HNjNtYqpY>gch8LB3ZeDTQV3zGG@)Q2Ywxt^H{hH@aa7%b-#5s&yp5mOCJ z$kmv~GOfSKTr!iEp&tAl)n+ISWu$qsj7feP{OhsvW6HTweKTDuVcT7rs^1O7a literal 0 HcmV?d00001 diff --git a/RentalProject/target/classes/org/example/Main.class b/RentalProject/target/classes/org/example/Main.class new file mode 100644 index 0000000000000000000000000000000000000000..6dfb9f41af424e6d758b211be1b91566ea9847a6 GIT binary patch literal 2700 zcma)8NpllN7=3L^8fiS>mBp+EZ14hBFa!sQCE&2gk!1%P6N8g5md5hfBaJgN0-Sx{ z6Ox>gTW*}4O36v6N^wYW$RW2><)5UAqT;+BEyx6_aH)E_zwUnD>+gI0wg33{*WUn~ z#5XGHP_H1MA&8Jb)4YC7k6L;@8y%gQH`1O!=$M%|y%PfU-93{E!UAn+I~UE`cGfbY zS=Y`-&#_UVNT3FR79Yd3qi0RaxM1iR!wF-Z!11Bj^hMWj-09T#bRuKuV~#CdxYLEa zXL^>AIXdk+>1oe!z3B-yQ+B~QYdZ`5^FF?cM#-{CU_*EE0nc&IG4t8Dh$&Kh{zVo1pX4K1OgNBXRB%ovsZ(?cD5ZKb)Q-kCfvljV85zr(MGqY!wL4 zI(BZDBm|C?UGsRQqs1QwP>WoOWn95_fsM5cPg&N8ohev`t702=YUsc&0gVKQ3a)48 z7%hQK6_y3hw4$dRM_)>su1AV{(5awH!(QwYX!T>Vb`7&eEE%!HBl+|&o3(r@UL~78 z4f`dVFcD7M_5vyHLBED5o}$t83`h5DhX-0iFHyF~8!&)F3Jz;{8b>Os@Yz+CFcWjS zn=)>YAjNfA?s!JSQN#oSdEeYt!LE@c!+4BJt))%GTm*5P(5UHW1?tRsW^{>f?*BM%geLABK(pv z1cGVHb`7bd5e+Gf@-lgLNk@BYC0v$AZHCIKR`5b4bma?m$uSvW6=P_W&4h-F@=64+ zOS`lrB6tx~3NCB7g6TC^dVI*hg(Re4cDD5Sk_X%imT8S%xFkUMkP6}MQ6qrr7tV5 zfMKsLNsOMkkv0}RQ`V6TvKr=OKpXwV&1;VRp#BgeIBdIfzLVO>RQ1jUXL6>s#P4axzRra~N$McU$pS4S`oF5o zh)JQ0>E4{cIzN*m`l6o*1xpG(U#m~Ql#_5(4UC66&SxNP$S?{-WWxKU8-a!t--r=I zrkl&OL_TjgLzeEkhKpS=`LM~qI*=zqY!^6+@+^zFZmX4+bdXe(m#9c)V-C}Kx_5xei8 zI~I_GKzR_9gJ5|O;-I&P12Lst`2~#S_c$VZg93LDkA>UAKjC=j2drxkw+DX4sat6C zO-;0^72E3FCqW66P=d86N(sfcJsC<Fg_zn-?nR8Zt3^!yh)XRm74ga~sB)r+*<}bZC?>@eYe79^g1+L@BU8hF zB+!EO*osE%;J1s<`T#8_(TXHCFijir7B=A%Y{pGK-rw>aTgG<$&eeZnC;p-`{wCHx z=oAg;5^dNkwxV0?K#$msUeSj>aR~dxAo|5=L`8ycU5aU$#9^`-5La+WT;+o%h4LLa zET9t(T=H73_K01w5uptp3Q)N(h-tS17b4Fi_<(yAvhBx*_=sqO=*7qEMRyYd?V?#og99-8i2flNRZ~y=R literal 0 HcmV?d00001 diff --git a/RentalProject/target/classes/org/example/Movie.class b/RentalProject/target/classes/org/example/Movie.class new file mode 100644 index 0000000000000000000000000000000000000000..f14df2476d08a097dd469044a4f73a096a8a8a9f GIT binary patch literal 1131 zcmb7?-)<5?6vn^d-_m7ifff{$s`VdiY4_S-G^RvDf?l*uFPeBUg$a&XcFiylU&c4^ zLKD%%3m?FTGM?GRw1M@a7khTj$^6cI=bQQc=jSf~&*9lfA#EY!Ad4JBDO6)meB_f4 zzVP~5Oc-)cWgzu4h9|ATdp_r$&x5gdqLmEB-Tzf)TKZm(YtikWx6d|^$A$&lK>-d! z`RXCB!?_d;*|7)|{VVGo4ZZ1L%b@v@RAQ(@Wr}476;sR%`Ba<2j)N*{3nA zC5CqNmZmaTlpT?q44bq%zG`FTAAf0NbZy$4Zl8oRH54zU(PKw9$xX%urH9JeUmrtA~tdHOfq{Z2hw%~h=*U~Xpt%RN}2=+-j}l)lo26q*!kgaS4- zDxgfUh9b4u#4c5j<3_lHyOdE&65-G>W<~EWlG2RCq@$XVlZjUJc%r^d?BPBMGQ5iYI5jYQbReuC`n ZRd_cM?x3*-f5(l_D>LsU!Uxf=!@t#r#@PS> literal 0 HcmV?d00001 diff --git a/RentalProject/target/classes/org/example/Person.class b/RentalProject/target/classes/org/example/Person.class new file mode 100644 index 0000000000000000000000000000000000000000..46a1ee256fd813aaf261c42e8af3b29a18cfedae GIT binary patch literal 898 zcmZ{i+fLg+5QhKF$w@GWq~TDGrGS*A5`F*>6{=b(QUpk#+;76l7&$g_oT?Aii&iQ^ z;(`a@p%DK#sUi|{GrP0@%XU4UVNgEtv5O)6j8EJwlN1=p&CZ6V}9xWoo}2A6Ai*ZAs6Vrq1K+vx{M<)aF3*W z!Nww%I8D1OQY|^F+V~*j@}{pnpA)`?*Ay4qUSQ6K{jQ0wbk|R2hCS_fbmU1sKFq~8 z-aw(&o`pG5uv`iwJ0xwb; zZ_AhAFzT5fo^a2Nyg3v{u*(-`=zf-wE^?OAD$|avr-FP= Wccd~6vPF>XcR=LJ3dmma^!-4L4^dt z5B>mulz8rJp3AcA%+B0%?mctvB!BMpjI1&oEOY_RCIcEE!_V(=3 zYI+KZmv-Cs4i%!s(rF5FNF_0EAPqwy-*GQ$)>pIj#j$Efy{^}3S*}9FK37on6tV(d zVA^S1-LqOLEJ|oeVQD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e#OvyatrZCXh|e}VIDvKBk_dG8X*GrQ(~ZxQ2jX08)^_oFvjcT9KS^L z6NvDw9rsyKgx}*;*%}y;*DWbl)c3NY&rp!i_zrwdrcc*u@l`aaJewUE8G-h-)i&P=)-K38jCd;@WWc`h)IG z&mT^1V&Qu{ld(Q4D=jkgH% zOQ9wr&k$pOj!1tLzQV&-FnhsQHD*I(wuQxgnOz~XNiw@iX47Og^8z#9PXCYD2H7^? G>wf_<*&_J> literal 0 HcmV?d00001 From ab085d615d41d1b95dd5d88f2ea9b3b704b52576 Mon Sep 17 00:00:00 2001 From: hosein Date: Wed, 24 May 2023 02:10:55 +0430 Subject: [PATCH 2/2] aded --- .../rental-proj}/.idea/.gitignore | 0 .../rental-proj}/.idea/compiler.xml | 0 .../rental-proj}/.idea/encodings.xml | 0 .../rental-proj}/.idea/jarRepositories.xml | 0 .../rental-proj}/.idea/misc.xml | 0 .../rental-proj}/pom.xml | 0 .../src/main/java/org/example/AllModules.java | 4 +- .../src/main/java/org/example/Book.java | 0 .../src/main/java/org/example/Customer.java | 3 +- .../src/main/java/org/example/Game.java | 0 .../src/main/java/org/example/Item.java | 2 +- .../src/main/java/org/example/Main.java | 14 +- .../src/main/java/org/example/Movie.java | 0 .../src/main/java/org/example/Person.java | 0 .../src/main/java/org/example/Rental.java | 11 +- .../main/java/org/example/RentalStore.java | 138 ++++++++++++++++++ .../rental-proj}/src/test/TestYourFork.json | 98 ++----------- .../classes/org/example/AllModules.class | Bin 0 -> 1939 bytes .../target/classes/org/example/Book.class | Bin .../target/classes/org/example/Customer.class | Bin 0 -> 1292 bytes .../target/classes/org/example/Game.class | Bin .../target/classes/org/example/Item.class | Bin 1121 -> 1121 bytes .../target/classes/org/example/Main$1.class | Bin .../target/classes/org/example/Main.class | Bin 0 -> 2904 bytes .../target/classes/org/example/Movie.class | Bin .../target/classes/org/example/Person.class | Bin .../target/classes/org/example/Rental.class | Bin 0 -> 1861 bytes .../classes/org/example/RentalStore.class | Bin 0 -> 4016 bytes RentalProject/project_should_be_here | 0 .../main/java/org/example/RentalStore.java | 72 --------- .../classes/org/example/AllModules.class | Bin 1879 -> 0 bytes .../target/classes/org/example/Customer.class | Bin 1486 -> 0 bytes .../target/classes/org/example/Main.class | Bin 2700 -> 0 bytes .../target/classes/org/example/Rental.class | Bin 1318 -> 0 bytes .../classes/org/example/RentalStore.class | Bin 2599 -> 0 bytes 35 files changed, 169 insertions(+), 173 deletions(-) rename {RentalProject => RentalProject-1/rental-proj}/.idea/.gitignore (100%) rename {RentalProject => RentalProject-1/rental-proj}/.idea/compiler.xml (100%) rename {RentalProject => RentalProject-1/rental-proj}/.idea/encodings.xml (100%) rename {RentalProject => RentalProject-1/rental-proj}/.idea/jarRepositories.xml (100%) rename {RentalProject => RentalProject-1/rental-proj}/.idea/misc.xml (100%) rename {RentalProject => RentalProject-1/rental-proj}/pom.xml (100%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/AllModules.java (87%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Book.java (100%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Customer.java (94%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Game.java (100%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Item.java (97%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Main.java (76%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Movie.java (100%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Person.java (100%) rename {RentalProject => RentalProject-1/rental-proj}/src/main/java/org/example/Rental.java (65%) create mode 100644 RentalProject-1/rental-proj/src/main/java/org/example/RentalStore.java rename {RentalProject => RentalProject-1/rental-proj}/src/test/TestYourFork.json (82%) create mode 100644 RentalProject-1/rental-proj/target/classes/org/example/AllModules.class rename {RentalProject => RentalProject-1/rental-proj}/target/classes/org/example/Book.class (100%) create mode 100644 RentalProject-1/rental-proj/target/classes/org/example/Customer.class rename {RentalProject => RentalProject-1/rental-proj}/target/classes/org/example/Game.class (100%) rename {RentalProject => RentalProject-1/rental-proj}/target/classes/org/example/Item.class (94%) rename {RentalProject => RentalProject-1/rental-proj}/target/classes/org/example/Main$1.class (100%) create mode 100644 RentalProject-1/rental-proj/target/classes/org/example/Main.class rename {RentalProject => RentalProject-1/rental-proj}/target/classes/org/example/Movie.class (100%) rename {RentalProject => RentalProject-1/rental-proj}/target/classes/org/example/Person.class (100%) create mode 100644 RentalProject-1/rental-proj/target/classes/org/example/Rental.class create mode 100644 RentalProject-1/rental-proj/target/classes/org/example/RentalStore.class delete mode 100644 RentalProject/project_should_be_here delete mode 100644 RentalProject/src/main/java/org/example/RentalStore.java delete mode 100644 RentalProject/target/classes/org/example/AllModules.class delete mode 100644 RentalProject/target/classes/org/example/Customer.class delete mode 100644 RentalProject/target/classes/org/example/Main.class delete mode 100644 RentalProject/target/classes/org/example/Rental.class delete mode 100644 RentalProject/target/classes/org/example/RentalStore.class diff --git a/RentalProject/.idea/.gitignore b/RentalProject-1/rental-proj/.idea/.gitignore similarity index 100% rename from RentalProject/.idea/.gitignore rename to RentalProject-1/rental-proj/.idea/.gitignore diff --git a/RentalProject/.idea/compiler.xml b/RentalProject-1/rental-proj/.idea/compiler.xml similarity index 100% rename from RentalProject/.idea/compiler.xml rename to RentalProject-1/rental-proj/.idea/compiler.xml diff --git a/RentalProject/.idea/encodings.xml b/RentalProject-1/rental-proj/.idea/encodings.xml similarity index 100% rename from RentalProject/.idea/encodings.xml rename to RentalProject-1/rental-proj/.idea/encodings.xml diff --git a/RentalProject/.idea/jarRepositories.xml b/RentalProject-1/rental-proj/.idea/jarRepositories.xml similarity index 100% rename from RentalProject/.idea/jarRepositories.xml rename to RentalProject-1/rental-proj/.idea/jarRepositories.xml diff --git a/RentalProject/.idea/misc.xml b/RentalProject-1/rental-proj/.idea/misc.xml similarity index 100% rename from RentalProject/.idea/misc.xml rename to RentalProject-1/rental-proj/.idea/misc.xml diff --git a/RentalProject/pom.xml b/RentalProject-1/rental-proj/pom.xml similarity index 100% rename from RentalProject/pom.xml rename to RentalProject-1/rental-proj/pom.xml diff --git a/RentalProject/src/main/java/org/example/AllModules.java b/RentalProject-1/rental-proj/src/main/java/org/example/AllModules.java similarity index 87% rename from RentalProject/src/main/java/org/example/AllModules.java rename to RentalProject-1/rental-proj/src/main/java/org/example/AllModules.java index 17e0ce0..fa4de4f 100644 --- a/RentalProject/src/main/java/org/example/AllModules.java +++ b/RentalProject-1/rental-proj/src/main/java/org/example/AllModules.java @@ -4,9 +4,9 @@ public class AllModules { public ArrayList games; - public ArrayList books; + public ArrayList books=new ArrayList<>(); public ArrayList movies; - public ArrayList customers; + public ArrayList customers=new ArrayList<>(); public ArrayList getGames() { return games; diff --git a/RentalProject/src/main/java/org/example/Book.java b/RentalProject-1/rental-proj/src/main/java/org/example/Book.java similarity index 100% rename from RentalProject/src/main/java/org/example/Book.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Book.java diff --git a/RentalProject/src/main/java/org/example/Customer.java b/RentalProject-1/rental-proj/src/main/java/org/example/Customer.java similarity index 94% rename from RentalProject/src/main/java/org/example/Customer.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Customer.java index ddb8bcc..badba7b 100644 --- a/RentalProject/src/main/java/org/example/Customer.java +++ b/RentalProject-1/rental-proj/src/main/java/org/example/Customer.java @@ -10,8 +10,7 @@ public class Customer { String phone; String address; List rentals=new ArrayList<>(); - - public Customer(String name, String email, String phone, String address, int id, List rentals) { + public Customer(String name, String email, String phone, String address, int id) { this.id = id; this.name = name; this.email = email; diff --git a/RentalProject/src/main/java/org/example/Game.java b/RentalProject-1/rental-proj/src/main/java/org/example/Game.java similarity index 100% rename from RentalProject/src/main/java/org/example/Game.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Game.java diff --git a/RentalProject/src/main/java/org/example/Item.java b/RentalProject-1/rental-proj/src/main/java/org/example/Item.java similarity index 97% rename from RentalProject/src/main/java/org/example/Item.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Item.java index 20f6f71..a8bc176 100644 --- a/RentalProject/src/main/java/org/example/Item.java +++ b/RentalProject-1/rental-proj/src/main/java/org/example/Item.java @@ -3,7 +3,7 @@ import java.util.Date; public class Item { - int id; + private int id; String title; String genre; Date releaseDate; diff --git a/RentalProject/src/main/java/org/example/Main.java b/RentalProject-1/rental-proj/src/main/java/org/example/Main.java similarity index 76% rename from RentalProject/src/main/java/org/example/Main.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Main.java index 220181a..589969b 100644 --- a/RentalProject/src/main/java/org/example/Main.java +++ b/RentalProject-1/rental-proj/src/main/java/org/example/Main.java @@ -13,28 +13,28 @@ public static void main(String[] args) throws IOException { Reader reader = new FileReader("C:\\Users\\NS\\IdeaProjects\\untitled9\\src\\test\\TestYourFork.json"); AllModules allModules = gson.fromJson(reader, new TypeToken() { }.getType()); - + Customer Hosein = new Customer("Hosein","hoseinama1383@gmail.com","09906652919","babol",4); Customer Joshn = allModules.getCustomers().get(0); Customer Emily = allModules.getCustomers().get(1); Customer Brown = allModules.getCustomers().get(2); for (Item tempItem : allModules.getBooks()) { - if (tempItem.id == 3) RentalStore.rentItem(tempItem, Joshn); - else if (tempItem.id == 6) { + if (tempItem.returnId() == 3) RentalStore.rentItem(tempItem, Joshn); + else if (tempItem.returnId() == 6) { RentalStore.rentItem(tempItem, Joshn); } } for (Item tempItem : allModules.getBooks()) { - if (tempItem.id == 1) RentalStore.rentItem(tempItem, Emily); - else if (tempItem.id == 7) { + if (tempItem.returnId() == 1) RentalStore.rentItem(tempItem, Emily); + else if (tempItem.returnId() == 7) { RentalStore.rentItem(tempItem, Emily); } } for (Item tempItem : allModules.getBooks()) { - if (tempItem.id == 9) RentalStore.rentItem(tempItem, Brown); - else if (tempItem.id == 4) { + if (tempItem.returnId() == 9) RentalStore.rentItem(tempItem, Brown); + else if (tempItem.returnId() == 4) { RentalStore.rentItem(tempItem, Brown); } } diff --git a/RentalProject/src/main/java/org/example/Movie.java b/RentalProject-1/rental-proj/src/main/java/org/example/Movie.java similarity index 100% rename from RentalProject/src/main/java/org/example/Movie.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Movie.java diff --git a/RentalProject/src/main/java/org/example/Person.java b/RentalProject-1/rental-proj/src/main/java/org/example/Person.java similarity index 100% rename from RentalProject/src/main/java/org/example/Person.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Person.java diff --git a/RentalProject/src/main/java/org/example/Rental.java b/RentalProject-1/rental-proj/src/main/java/org/example/Rental.java similarity index 65% rename from RentalProject/src/main/java/org/example/Rental.java rename to RentalProject-1/rental-proj/src/main/java/org/example/Rental.java index 847293d..d317873 100644 --- a/RentalProject/src/main/java/org/example/Rental.java +++ b/RentalProject-1/rental-proj/src/main/java/org/example/Rental.java @@ -6,14 +6,16 @@ public class Rental { int id; Item item; Customer customer; + Integer customerId; Date rentalDate; Date returnDate; public Rental(Item item, Customer customer) { - this.id = customer.id + item.id; + this.id = customer.id + item.returnId(); + this.customer= new Customer(customer.name, customer.email, customer.phone, customer.address, customer.id); this.item = item; - this.customer=customer; - item.isAvailable=false; + this.customerId = customer.id; + item.isAvailable = false; } public int getId() { @@ -26,7 +28,8 @@ public Item getitem() { } public Customer getCustomer() { - return customer; + RentalStore rentalStore = new RentalStore(); + return rentalStore.getCustomerById(customerId); } public Date getRentalDate() { diff --git a/RentalProject-1/rental-proj/src/main/java/org/example/RentalStore.java b/RentalProject-1/rental-proj/src/main/java/org/example/RentalStore.java new file mode 100644 index 0000000..09905e2 --- /dev/null +++ b/RentalProject-1/rental-proj/src/main/java/org/example/RentalStore.java @@ -0,0 +1,138 @@ +package org.example; + +import java.util.ArrayList; +import java.util.Date; +import java.util.List; + +public class RentalStore { + List books = new ArrayList<>(); + List movies = new ArrayList<>(); + List games = new ArrayList<>(); + List customers = new ArrayList<>(); + + public void Register(Customer customer) { + if (!(customers.contains(customer))) customers.add(customer); + } + + ///////////////////////////////////////////////////// + public void addMovies(Item item) { + if (item instanceof Movie) { + movies.add((Movie) item); + } else if (item instanceof Book) { + books.add((Book) item); + } else if (item instanceof Game) { + games.add((Game) item); + } + } + + public void removeMovies(Item item) { + if (item instanceof Movie) { + movies.remove((Movie) item); + } + else if (item instanceof Book) { + books.remove((Book) item); + } + else if (item instanceof Game) { + games.remove((Game) item); + } + } +//////////////////////////////////////////////////// + public List getAvailableMovie() { + List availableList = null; + for (Movie i : movies) { + if (i.isavailable()) { + availableList.add(i); + } + } + return availableList; + } + + public List getAvailableBook() { + List availableList = null; + for (Book i : books) { + if (i.isavailable()) { + availableList.add(i); + } + } + return availableList; + } + + public List getAvailableGame() { + List availableList = null; + for (Game i : games) { + if (i.isavailable()) { + availableList.add(i); + } + } + return availableList; + } +/////////////////////////////////////////////////// + + public static void rentItem(Item item, Customer customer) { + if (item instanceof Movie || item instanceof Book || item instanceof Game) { + Rental rental = new Rental(item, customer); + + + if (customer.rentals == null) { + customer.rentals = new ArrayList<>(); + } + if (!(customer.rentals.contains(rental.item))) { + customer.rentals.add(rental); + rental.rentalDate = new Date(); + + } + + } + } + ////////////////////////////////////////////// + + public static void returnItem(Rental rental) { + rental.rentalDate = new Date(); + rental.item.setAvailable(); + return; + } + +////////////////////////////////////////////////////////// + public Customer getCustomerById(int id) { + for (Customer i : + customers) { + if (id == i.id) { + return i; + } + } + return null; + } + + public Item getMovieById(int id) { + for (Movie i : + movies) { + if (id == i.returnId()) { + Item item = (Movie) i; + return item; + } + } + return null; + } + public Item getBookById(int id) { + for (Book i : + books) { + if (id == i.returnId()) { + Item item = (Book) i; + return item; + } + } + return null; + } + public Item getGameById(int id) { + for (Game i : + games) { + if (id == i.returnId()) { + Item item = (Game) i; + return item; + } + } + return null; + } + } + + diff --git a/RentalProject/src/test/TestYourFork.json b/RentalProject-1/rental-proj/src/test/TestYourFork.json similarity index 82% rename from RentalProject/src/test/TestYourFork.json rename to RentalProject-1/rental-proj/src/test/TestYourFork.json index 6ace936..c4a6d5d 100644 --- a/RentalProject/src/test/TestYourFork.json +++ b/RentalProject-1/rental-proj/src/test/TestYourFork.json @@ -315,92 +315,20 @@ "rentals": [] }, { - "id": 4, - "item": { - "id": 3, - "title": "Pride and Prejudice", - "genre": "Romance", - "releaseDate": "Jan 28, 1813, 12:00:00 AM", - "isAvailable": false - }, - "customer": { - "id": 1, - "name": "John Smith", - "email": "johnsmith@example.com", - "phone": "1234567890", - "address": "123 Main Street", - "rentals": [] - }, - "rentalDate": "May 19, 2023, 8:36:51 PM" - }, - { - "id": 7, - "item": { - "id": 6, - "title": "The Great Gatsby", - "genre": "Fiction", - "releaseDate": "Apr 10, 1925, 12:00:00 AM", - "isAvailable": false - }, - "customer": { - "id": 1, - "name": "John Smith", - "email": "johnsmith@example.com", - "phone": "1234567890", - "address": "123 Main Street", - "rentals": [] - }, - "rentalDate": "May 19, 2023, 8:36:51 PM" - }, - { - "id": 4, - "item": { - "id": 3, - "title": "Pride and Prejudice", - "genre": "Romance", - "releaseDate": "Jan 28, 1813, 12:00:00 AM", - "isAvailable": false - }, - "customer": { - "id": 1, - "name": "John Smith", - "email": "johnsmith@example.com", - "phone": "1234567890", - "address": "123 Main Street", - "rentals": [] - }, - "rentalDate": "May 19, 2023, 8:39:58 PM" - }, - { - "id": 7, - "item": { - "id": 6, - "title": "The Great Gatsby", - "genre": "Fiction", - "releaseDate": "Apr 10, 1925, 12:00:00 AM", - "isAvailable": false - }, - "customer": { - "id": 1, - "name": "John Smith", - "email": "johnsmith@example.com", - "phone": "1234567890", - "address": "123 Main Street", - "rentals": [] - }, - "rentalDate": "May 19, 2023, 8:39:58 PM" + "id": 2, + "name": "Emily Johnson", + "email": "emilyjohnson@example.com", + "phone": "9876543210", + "address": "456 Oak Avenue", + "rentals": [] }, { - "id": 4, - "item": { - "id": 3, - "title": "Pride and Prejudice", - "genre": "Romance" - } + "id": 3, + "name": "Michael Brown", + "email": "michaelbrown@example.com", + "phone": "5555555555", + "address": "789 Elm Street", + "rentals": [] } ] -} - - - - +} \ No newline at end of file diff --git a/RentalProject-1/rental-proj/target/classes/org/example/AllModules.class b/RentalProject-1/rental-proj/target/classes/org/example/AllModules.class new file mode 100644 index 0000000000000000000000000000000000000000..5068eb31e95d89827ff6b705663a99283e9e2d44 GIT binary patch literal 1939 zcma)7ZBNrs6h7U1XJvE1m;yQ!bQ>?lcasqelIWMACKwVwcB7faZY5nuqbA<@Ji z;Eyss=eFI(avS>P_ME%(JkLE(&+Y#H`}K#2Uel{QB`BGtltyXFC{#Q#&J5i)`d$4) z`^4;c3T1YzzUA#Il&sZ{vXoP3Rum0A%hvZ?*Enxk120cmN~&~&v@G4!Xod<3l^wUM zo8OGyscq_ewte6n4{dXxP`d3nU-6u8Ntl|dNcz;k-0JK)_pjplhb-8Fiq z*jdo1!aJFsb7nEMdT4d~hBtIgh3Yc;oz~>3-hrsO+l*EF28R~4jq7<2_&B0?^ZMfb zphr=k+INm|_Cm|*o9~Ccw&{K{+BSAdEvIAHM}}*09&Dz(FBZD4Txn`-H5$uxO^>@o z)k00`2#VI_zeIS&lxzklV*y9TsQ?ORfZT{9Ikr&)H1r8*Jq|jo7ry2OBOfX?**j_0 zk1(=VO+G&jjoy%Aqy{k$s|6OtK?V*nQUx;fXfuXrXc1#IV8fkNts;1s?%1rSw{X+9hWypK$w2egV~ zF}042snd<0H2WPvf|!Jr8CDgmC&XPd?(wuQAhDzo1!mHYrTu{{o^Vc)Ki^%6?T~44dY^^sSL;yu&Zw zH;ujCmaF8aRjN=~iBR!JX;Ni|c%*!l$B3TDRm#&Ut58{sQ1J(JQl*04LzSn9p2=0j dEKWLBgGxO@#UJ}gl@ikh3%InD0=87Cq9QD9*Uu*!Ow(vWLaGr%;^P1ly3MjQ%VPBR`09fu zk|vt?1N>3OJF_L$Wqt8sXYQWNIrrR;pTEBS0PqY?Gl(IsBVj;8k|B4--*L;~?$~-c zI1@vkA$e%Kw%=xm*BgBuDTYn;XztsNb>w;cL)V`98R&?oaSeu!tbsMGGZd!Y*b?vg zmM?nNhax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Zh0b-R(pnc@VQu#a>-7pLTsg$GL)?sF>3;(7nM|`TU0pHo z3CX0{qpz{chysuC%>-IoQK+D%^Al-(JJI>>ap%%R=kM@+n0Y;{DW&^(H|kqZ#WHWm rrC1fIQIAskJup@LfG1(BWyaE-NzDJIXVd?ngq0YJ#HcN{LGAqu_BeQi literal 0 HcmV?d00001 diff --git a/RentalProject-1/rental-proj/target/classes/org/example/RentalStore.class b/RentalProject-1/rental-proj/target/classes/org/example/RentalStore.class new file mode 100644 index 0000000000000000000000000000000000000000..c9c14f661893e6f14989278634b11fb4b27bf44d GIT binary patch literal 4016 zcma)9SyL2O6#kkS7#Lav*-;S@5f~7ROO#Pm5R?RP!JwihX@(YCXCX5KLNtj>G@Hr0 zRwd<|FL^LkE@iArB~__PRenVBkbhyBnD5-~=~j=uo0c=JUVg73?(%b?6sm+vPXlbrFG1QLJj3gX(nlfI}gU= z#{7_#Nc!P}rwGN+eORTV1gkYv$Kq3+=A03k4x61P%xKaGk0xVrQ$zklEOt3TcSC7Y zVkIaR%5jjb6tYs!dRH36%MEO%j#FkX+s1Zp~XeN=2Ma+1j7njP>cwyDBV`J*nTs323yC)K!c8ra@%7}PWrG(Ls=$=VFBdBW&+O?_mYecTXLj_ z2~|wC>Sz;_1#y#vl&D=t2euNDl{Di9L!zOor8OfKgN{5{j4o{R;Vm88u|va}G^vz| z2H!;^F=Ea!Rm>1sbYYi{x3OD;H>$)HDchNR{b)qDj-Z$=wh~Oc6*eZqrXNk{_M;iy zKJ2H*OrmxU{pi6#sh3_2ftI061%iqMvm|{^dV;NEML2|h9|m+BmdsUTUQDTxO@?e}I#FAxM`SM{nE7gaLBpD1zDfZx)j^j9?!Ec+Cv+R-+Nzjjzc+ZD1 z9j8 zK7_4VoOfA3?5Gok+cFYL1vfJ=^V6x|Y*}D8JKMHFNq1=`Dk*~8npcIPp?MjLZvA8# zlrqRQs7hmbgKh<}yrW6GD>%<&qO*~+!eeKhWY~486I2UTXQ$jzlEkbg=TvTc=cR9I zTLxRROs0-$RHwFzm#tcvtEz?q2O8BR2)35&gn_;DkH%)=A#=czYA&^rsAp-b3|Ef- zVm^t0mw)++LBj-Bc?j{B&yu^J%D(6rr3pk4quFV7L#yHPBg7p) z-#dN=0>7d09xCXeH1I1LpF^BHL>J{vw%kv7Q%YV#dGkG#QNNt>W?P;HRZqr1Ie#k% ztP&dts|(e9;cC#&7^Hy?xIhQw-Ee^B!&6gT!A)WXP+Jy(YReZw6?rby^@Lhaa1DgI zkx(}gY7?P0uN-O;GmNH`&5!(7N^!e3BmsSnfQI4r=jhaM4;#4HsewTr>3E7g_fQ<@ zaKiffufQW-^Qyeou?m4!nrb7a0Fks~EB|amr^3|0{BK~+XK{rqI&%VU`+h_>zZqt9;DktBWx3FT$Wn80=k!!FIaXL8Lp$U>EW4CcZs6 z46dz+L1<|PpYZt8MHrMX!k}3g>|2JxJ~HSbgZ*T1fDC%cpf88PXDec0F3sRN=fe$} zw};Q~ECfmH={EM}efAn#@jhpd>b(9J=sD9Cc!mSRfye0k10?}>JoSmB{V|R>bE8)6 z?HX%;fgujDktaBsZh=P5Cg2GBbdWTMNOPDJkK!PXad({GSYsJOzjjZi>jMER0-|^_->wh%qF?)8}!+C=L`3Mo} zB(~rJyKTxPyPm^(meW(x(C!YZcKMK`f0?Kx`wD)x(mH7+4PW9b2iXtY%joY~I0EWZ z$Qp_4Db77WQAfA8)=PAMXP~nuK$z$vL>EO1kpwurw{j-R0Bs}l7GjgJ>7`bQI}5s8 ztX*%y+F)b-`i)p~n%%|Pq_BRtB-UA?xI(OR#5GT>SBdr7qFC*&Um4bK-iS4)tzE3m k3ahas*6YN2gII48>n&ovO{{ko#cKEW%CO#LZu0Q${|#I}761SM literal 0 HcmV?d00001 diff --git a/RentalProject/project_should_be_here b/RentalProject/project_should_be_here deleted file mode 100644 index e69de29..0000000 diff --git a/RentalProject/src/main/java/org/example/RentalStore.java b/RentalProject/src/main/java/org/example/RentalStore.java deleted file mode 100644 index 0d50c81..0000000 --- a/RentalProject/src/main/java/org/example/RentalStore.java +++ /dev/null @@ -1,72 +0,0 @@ -package org.example; - -import java.util.ArrayList; -import java.util.Date; -import java.util.List; - -public class RentalStore { - List items; - - List customers; - - public void Register(Customer customer) { - customers.add(customer); - } - - public void addItem(Item item) { - items.add(item); - } - - public void removeItem(Item item) { - items.remove(item); - } - - public List getAvailableItem() { - List availableList = null; - for (Item i : items) { - if (i.isavailable()) { - availableList.add(i); - } - } - return availableList; - } - - public static void rentItem(Item item, Customer customer) { - Rental rental = new Rental(item, customer); - rental.rentalDate = new Date(); - System.out.println(); - if (customer.rentals == null) { - customer.rentals = new ArrayList<>(); - } - customer.rentals.add(rental); - - } - - public static void returnItem(Rental rental) { - rental.rentalDate = new Date(); - rental.item.setAvailable(); - return; - } - - - public Customer getCustomerById(int id) { - for (Customer i : - customers) { - if (id == i.id) { - return i; - } - } - return null; - } - - public Item getItemById(int id) { - for (Item i : - items) { - if (id == i.returnId()) { - return i; - } - } - return null; - } -} - diff --git a/RentalProject/target/classes/org/example/AllModules.class b/RentalProject/target/classes/org/example/AllModules.class deleted file mode 100644 index 3c45d3c3483b8e822e14691dbb7e8446ef213f8e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1879 zcma)6+iuf95FO|4;F6FwX(*Sr&_b?txjm&SDwW_R1*D?9JE;|1oVarAivATyAS536 z06q$F#+M|u)~a82XJ_Y}Gkd)2zyE&!A)?pxsz@nH=P9F5mU0r6&$UZUHMQwj{V+V& zM~+0f17m79hZ3b5&4Ek>lJitl=oTpw)hv6g>R+|Vg{iAYrg>tWxu!moC_C0BJXiZ3 zq3al?dSu($Ro|F7J!ZMBP>CtBL(BRyJ8C1=`{zqve!+%x(JQ#2r)u~ zn1|H@i;^G%hZrdX8G6)BAR1c4SOwVd&@gE~0X!^+N6b(>wOo6ozcu*Al@=Fij~^;+ z;~l2(XULGmFC1eHs}!vx!gHOk>xl4J=j*$O@KWdN4U!S#mxA#g7*xy>=4|U1N#8xn z`xto}NqT^h!5lxNP0SK)p_xYv`*#XI}kfaak|wnRPd;Mi50z`Re^Q8dYgPr5U5*U+iU-Ds9YFo+EkzH&gWTKaXf@8~^|S diff --git a/RentalProject/target/classes/org/example/Customer.class b/RentalProject/target/classes/org/example/Customer.class deleted file mode 100644 index bcf8d68906fe48987d38160ac9856d5809d6ca62..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1486 zcmcIjT~8BH5Iwi;cA+j%pnQpnd4x+zPxTe966`AdzWbw$=iasvm*vI8hu%9ooilUJ%-o;9zJ3Sr6i;$UA#EaK!9Z3ZeiS#h8!7?#oVH9Hmg;v;b z+z+yO>buTvryaGLZYW@eZV*Yo&1$tjnN*UBN-%C=0+RwMuPz{}$~9$S8Z!c!KsH^0 zi5^U|+>b&pXlUS^h3hKHaGTQe74C+Go7!`F+zMRfS+H#OwF@rzEXn}$kE#y2Zc`zka{Ea9tjjLIj`W&kbTMzwWxBZanc->N;kkq%o}+KAGZqDEOi+m~h2 zSH?O|CCcHgVhsBW@*ioWG~KLr&S*-#Bu1Z-zy>xGz=cmS@O&cJNd(Wv!3&AtyNTfW pICwb`d=K~ggS@CY7YDB;fETs22UPtqk-@Eal5#>4fk!&cmBp+EZ14hBFa!sQCE&2gk!1%P6N8g5md5hfBaJgN0-Sx{ z6Ox>gTW*}4O36v6N^wYW$RW2><)5UAqT;+BEyx6_aH)E_zwUnD>+gI0wg33{*WUn~ z#5XGHP_H1MA&8Jb)4YC7k6L;@8y%gQH`1O!=$M%|y%PfU-93{E!UAn+I~UE`cGfbY zS=Y`-&#_UVNT3FR79Yd3qi0RaxM1iR!wF-Z!11Bj^hMWj-09T#bRuKuV~#CdxYLEa zXL^>AIXdk+>1oe!z3B-yQ+B~QYdZ`5^FF?cM#-{CU_*EE0nc&IG4t8Dh$&Kh{zVo1pX4K1OgNBXRB%ovsZ(?cD5ZKb)Q-kCfvljV85zr(MGqY!wL4 zI(BZDBm|C?UGsRQqs1QwP>WoOWn95_fsM5cPg&N8ohev`t702=YUsc&0gVKQ3a)48 z7%hQK6_y3hw4$dRM_)>su1AV{(5awH!(QwYX!T>Vb`7&eEE%!HBl+|&o3(r@UL~78 z4f`dVFcD7M_5vyHLBED5o}$t83`h5DhX-0iFHyF~8!&)F3Jz;{8b>Os@Yz+CFcWjS zn=)>YAjNfA?s!JSQN#oSdEeYt!LE@c!+4BJt))%GTm*5P(5UHW1?tRsW^{>f?*BM%geLABK(pv z1cGVHb`7bd5e+Gf@-lgLNk@BYC0v$AZHCIKR`5b4bma?m$uSvW6=P_W&4h-F@=64+ zOS`lrB6tx~3NCB7g6TC^dVI*hg(Re4cDD5Sk_X%imT8S%xFkUMkP6}MQ6qrr7tV5 zfMKsLNsOMkkv0}RQ`V6TvKr=OKpXwV&1;VRp#BgeIBdIfzLVO>RQ1jUXL6>s#P4axzRra~N$McU$pS4S`oF5o zh)JQ0>E4{cIzN*m`l6o*1xpG(U#m~Ql#_5(4UC66&SxNP$S?{-WWxKU8-a!t--r=I zrkl&OL_TjgLzeEkhKpS=`LM~qI*=zqY!^6+@+^zFZmX4+bdXe(m#9c)V-C}Kx_5xei8 zI~I_GKzR_9gJ5|O;-I&P12Lst`2~#S_c$VZg93LDkA>UAKjC=j2drxkw+DX4sat6C zO-;0^72E3FCqW66P=d86N(sfcJsC<Fg_zn-?nR8Zt3^!yh)XRm74ga~sB)r+*<}bZC?>@eYe79^g1+L@BU8hF zB+!EO*osE%;J1s<`T#8_(TXHCFijir7B=A%Y{pGK-rw>aTgG<$&eeZnC;p-`{wCHx z=oAg;5^dNkwxV0?K#$msUeSj>aR~dxAo|5=L`8ycU5aU$#9^`-5La+WT;+o%h4LLa zET9t(T=H73_K01w5uptp3Q)N(h-tS17b4Fi_<(yAvhBx*_=sqO=*7qEMRyYd?V?#og99-8i2flNRZ~y=R diff --git a/RentalProject/target/classes/org/example/Rental.class b/RentalProject/target/classes/org/example/Rental.class deleted file mode 100644 index bd32468d0c0b2f1dfa6948a7d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