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.
Code:
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[2][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(){ System.out.println("Enter CD/DVD information"); // Add code here !! System.out.println("Title: "); // Add code here !! System.out.println("Company: "); // Add code here !! System.out.println("Release date: "); // Add code here !! } public static void rentalDvdCd(){ System.out.println("Are you an existing customer ? "); // Add code here !! System.out.println("DVD title "); // Add code here !! System.out.println("CD title "); // Add code here !! System.out.println("rental date:"); // Add code here !! System.out.println("return date:"); // Add code here !! } public static void returnDvdCd(){ System.out.println("Return DVD/CD "); // Add code here !! System.out.println("Title: "); // Add code here !! } public static void reportDvdCd(){ String name, code, title; int index, indexNum; 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started