Question: This DVD Rental System is to be developed with methods using the Java programming language. The DVD rental shop has several DVDs and CDs, and
This DVD Rental System is to be developed with methods using the Java programming language. The DVD rental shop has several DVDs and CDs, and many customers. Each customer is allowed to rent maximum of five DVDs and CDs at any time.
Upon returning DVDs and CDs, the shop assistant shall compute the total fees. The rental fee for each CD is $3 whereas a customer needs to pay $5 per DVD as a rental fee. The borrowing periods of items (CD and DVD) is one week. The customer must pay a fine of $1 per day for returning CD and DVD later than due date.
public class DVDassign {
static int maxCustomer = 50, maxItem = 5; static String[][] customer_record = new String[maxCustomer][5]; static String[][] rental_record = new String[maxCustomer][maxItem]; static String[][] dvd_cd_list = new String[500][4]; public static void main(String[] args){ Scanner input = new Scanner(System.in); int choice = 0; while(true){ System.out.println("---------------------- DVD/CD Rental System ------------------------"); System.out.println("1. Add customer "); System.out.println("2. Delete customer "); System.out.println("3. Modify customer "); System.out.println("4. Add DVD/CD "); System.out.println("5. Rental DVD/CD "); System.out.println("6. Return DVD/CD "); System.out.println("7. Report DVD/CD store information "); System.out.println("8. Exit "); System.out.println("Enter the number : " ); choice = input.nextInt(); switch (choice){ case 1: addCustomer(); break; case 2: delCustomer(); break; case 3: modifyCustomer(); break; case 4: addDvdCd(); break; case 5: rentalDvdCd(); break; case 6: returnDvdCd(); break; case 7: reportDvdCd(); break; case 8: exit(); break; default: invalidInput(); break; } } } public static void addCustomer(){ Scanner input = new Scanner(System.in); String name, address, enrollingDate, brCode; System.out.println("Enter your information"); System.out.println("Name: "); name = input.nextLine(); System.out.println("Address: "); address = input.nextLine(); System.out.println("Enrolling Date:"); enrollingDate = input.nextLine(); for (int i=0; i public static void addDvdCd(){ Scanner input = new Scanner(System.in); String cddvdinfo,title, company, releaseDate; System.out.println("Enter CD/DVD information"); cddvdinfo = input.nextLine(); System.out.println("Title: "); title = input.nextLine(); System.out.println("Company: "); company = input.nextLine(); System.out.println("Release date: "); releaseDate = input.nextLine(); for (int i=0; i System.out.println("Report DVD/CD rental store information "); // Add code here !! System.out.println(" Video Code "+"\t"+" Title "+"\t"+" Borrowed by "); // Add code here !! } public static void exit(){ System.exit(1); } public static void invalidInput(){ System.out.println("Invalid inuput !!!"); } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
