Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Write a Java Program to calculate the book rental prices depending on the type of renter. Following are the details that will be needed to
Write a Java Program to calculate the book rental prices depending on the type of renter. Following are the details that will be needed to write a program Book Name Head First Java Java How to Thinking in Java Book Renta for Book Rental for Faculty 2.00 month 3.00month 1.00month 0.50month 1.50 /month am 1.00 /month Input format: Following will be user inputs: 1. Renter Type-0:Student and I: Faculty 2. Book Name: 0: Abort Book Rental 1: Head First Java 2: Java How to program 3: Thinking in Java 3. Rental months The number or 2 will be generated randomly by the program where means true and 2 means false 4. Is renter on hold 1:true or 2:false Type of Renter: Student Book Name Thinking in Java Head First Java Total Price S30.00 $10.00 Rental months 10 There is hold on account so aborting the program 1 Read renter type 2. If input is invalid show appropriate message and exit the program 3. Checks renter is on hold or not 4 If on hold show appropriate message and exit the program 5. Read books 6. If input is invalid show appropriate message and exit the program 7. Calculate total and append in output string & Perform again from step 4 until user inputs to abort book rental. 9. At the end as usual display the output as mentioned in output format. Program must adhere to the following specifications: . If the user does not provide valid input, the program must not abnormally abort, instead it 2. 3. 4. Book code entered needs to be validated to be one of the above 5. Use Math Random number to generate must show a proper eror message. A similar requirement for invalid inputs. The program must continue reading the inputs, calculating and displaying the output using JOptionPane to show Message box in the above format and title should be "Book Rental Use book codes as above while reading the inputs and convert the code to book name while displaying the output. or 2 number for renter is on hold or not. 1 will be on hold which is true value and 2 will be not on hold which is false value. Math.random)((maxnin) 1)) mir For a given renter type entered, the program will loop reading inputs for multiple products until 0 is entered to abort or stop. 6. Write a Java Program to calculate the book rental prices depending on the type of renter. Following are the details that will be needed to write a program Book Name Head First Java Java How to Thinking in Java Book Renta for Book Rental for Faculty 2.00 month 3.00month 1.00month 0.50month 1.50 /month am 1.00 /month Input format: Following will be user inputs: 1. Renter Type-0:Student and I: Faculty 2. Book Name: 0: Abort Book Rental 1: Head First Java 2: Java How to program 3: Thinking in Java 3. Rental months The number or 2 will be generated randomly by the program where means true and 2 means false 4. Is renter on hold 1:true or 2:false Type of Renter: Student Book Name Thinking in Java Head First Java Total Price S30.00 $10.00 Rental months 10 There is hold on account so aborting the program 1 Read renter type 2. If input is invalid show appropriate message and exit the program 3. Checks renter is on hold or not 4 If on hold show appropriate message and exit the program 5. Read books 6. If input is invalid show appropriate message and exit the program 7. Calculate total and append in output string & Perform again from step 4 until user inputs to abort book rental. 9. At the end as usual display the output as mentioned in output format. Program must adhere to the following specifications: . If the user does not provide valid input, the program must not abnormally abort, instead it 2. 3. 4. Book code entered needs to be validated to be one of the above 5. Use Math Random number to generate must show a proper eror message. A similar requirement for invalid inputs. The program must continue reading the inputs, calculating and displaying the output using JOptionPane to show Message box in the above format and title should be "Book Rental Use book codes as above while reading the inputs and convert the code to book name while displaying the output. or 2 number for renter is on hold or not. 1 will be on hold which is true value and 2 will be not on hold which is false value. Math.random)((maxnin) 1)) mir For a given renter type entered, the program will loop reading inputs for multiple products until 0 is entered to abort or stop. 6
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