Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

In JAVA Part A: Book class (Total: 40 points] a. Add another .java file called Book into the same folder MidtermExam1 Makeup. [5 points) b.

image text in transcribed

image text in transcribed

In JAVA

Part A: Book class (Total: 40 points] a. Add another .java file called Book into the same folder MidtermExam1 Makeup. [5 points) b. Add the following private instance variables. [5 points] Variable name title author price id isReference Data type String String double int boolean c. Generate setters and getters for the instance variables. [5 points) d. Add the following new constructor. [10 points) as public Book(String title, String author): Takes the title and the parameters and sets the instance variables. Set the remaining instance variables to random values as follows. Variable name price id isReference Description (both lower and upper bounds are inclusive) Set to a random double number between 25.0 - 150.5 Set to a random integer number between 1 - 5000 Set to true if the id is less than 500. Set to false otherwise. e. Add the displayInfo() method which displays the Car information as follows. [5 points) Book information: Price: $ Library ID: Reference section? f. Add the overDueFine(int days) method which takes the number of overdue days as input, calculate and return the total fine (integer) using the following formula. The fine must be roundup to the next integer. (10 points) fine amount = $1.5 for each overdue day plus 3% of the book price as the tax Math.ceil() method returns a double value. Use type casting to change it to an integer value. Part B: JavaDoc comments [Total: 25 points] Add JavaDoc comments in Book class to describe the class, constructor, and all the methods (getters, setters, and instance methods). Part C: Mid MainDriver class [Total: 35 points] Within the main method: a. Take user input for the title and the author of a book. [10 points] b. Create an object of the Book class called myBook using the constructor defined in Part A(d) by passing the user input as arguments. [5 points] c. Call the displayInfo() method using the myBook object. [5 points] d. Set the value of the myBook's price to $50.25 [5 points] e. Add a testbench to verify that the overDue Fine method in Book class is working correctly. Use the myBook object to call the method. [10 points] Submission. Zip file from your project folder and submit via Moodle Midterm Programming Exam | link. Again... o Make sure you double-check that your submission file contains the whole project!!! o Make sure you SAVE before you EXPORT to a .zip file

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Advances In Databases And Information Systems 14th East European Conference Adbis 2010 Novi Sad Serbia September 2010 Proceedings Lncs 6295

Authors: Barbara Catania ,Mirjana Ivanovic ,Bernhard Thalheim

2010th Edition

3642155758, 978-3642155758

More Books

Students also viewed these Databases questions

Question

1. Discuss the potential legal issues that relate to training.

Answered: 1 week ago

Question

3. Design a program for preparing for cross-cultural assignments.

Answered: 1 week ago

Question

2. Develop a program for effectively managing diversity.

Answered: 1 week ago