Imagine you are developing a software system for a library to track the books. Each book...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Imagine you are developing a software system for a library to track the books. Each book has attributes such as title, author, and year of publication. Task: Create a Java program that does the following: 1. Define a Book Class: Define a class named Book. It should have three private instance variables: title (String), author (String), and year (int). Include a constructor that allows you to set all three values at once. Also, include getter methods for each of these variables. 2. Display the Information about a book: Write a method (in class Book) that prints out the information of a book in the format: "Title by Author (Year)". The method should use the defined getter methods to access the private variables. 3. Create an Array of Book Objects: In your Main class, create an array named library that can hold 5 Book objects. 4. Populate the Array: Fill the library array with five (5) different Book objects, representing books of your choice. Initialize each Book with appropriate values for title, author, and year. 5. Display the Information about all books in the library: Write a method (in class Main) that takes the array of Book objects as a parameter and prints out the information of each book in the format: "Title by Author (Year)". Use the method to display all books information. Imagine you are developing a software system for a library to track the books. Each book has attributes such as title, author, and year of publication. Task: Create a Java program that does the following: 1. Define a Book Class: Define a class named Book. It should have three private instance variables: title (String), author (String), and year (int). Include a constructor that allows you to set all three values at once. Also, include getter methods for each of these variables. 2. Display the Information about a book: Write a method (in class Book) that prints out the information of a book in the format: "Title by Author (Year)". The method should use the defined getter methods to access the private variables. 3. Create an Array of Book Objects: In your Main class, create an array named library that can hold 5 Book objects. 4. Populate the Array: Fill the library array with five (5) different Book objects, representing books of your choice. Initialize each Book with appropriate values for title, author, and year. 5. Display the Information about all books in the library: Write a method (in class Main) that takes the array of Book objects as a parameter and prints out the information of each book in the format: "Title by Author (Year)". Use the method to display all books information.
Expert Answer:
Answer rating: 100% (QA)
Certainly Heres a Java program that follows the task instructions First define the Book class as spe... View the full answer
Related Book For
Database Systems A Practical Approach to Design Implementation and Management
ISBN: 978-0132943260
6th Edition Global
Authors: Thomas Connolly, Carolyn Begg
Posted Date:
Students also viewed these computer network questions
-
Question 3: 15 marks (a)What is the profitability index of an investment with cash flows in years 0 thru 4 of-340, 120, 130, 153, and 166, respectively, and a discount rate of 16 percent? Should the...
-
Predictive text entry systems are familiar on touch screens and mobile phones. This question asks you to consider how the same principles might be used in a programming editor for creating Java code....
-
answer the question clearly You are building a flight-control system for which a convincing safety case must be made. Would you assign the tasks of safety requirements engineering, test case...
-
You need to write a paper about the leadership and your responsibility in an organization. Which types of problems can be occurred and how can you face them
-
From the following compressibility-factor data for CO2 at 150°C prepare plots of the fugacity surd fugacity coefficient of CO2 vs, P tor pressures up to 500 bar. Compare results with those found...
-
Assuming there was no principal pay down during the five years, what is the ending balance for John (see problem #1) at the end of five years?
-
What is your role in your personal financial program?
-
The following probabilistic activity time estimates are for the CPM/PERT network in Problem Determine the following: a. Expected activity times b. Earliest start and finish times c. Latest starts and...
-
r_f 2% E(r_P) 10% ?_P 18% A 4 W P 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 0.5 0.55 0.6 0.65 0.7 0.75 0.8 0.85 0.9 0.95 1 . 4....
-
A heat engine running backward is called a refrigerator if its purpose is to extract heat from a cold reservoir. The same engine running backward is called a heat pump if its purpose is to exhaust...
-
Arrow Co. entered into a contract with a customer for $350,000. The contract is for the delivery of equipment and a 3-year service maintenance contract for the equipment. Arrow sells separately the...
-
We gave a C function for bigint_equal to test if two big integers are equal. This function made use of bigint_compare. Write the remaining comparison functions for , , and .
-
Assume a simple floating-point representation that uses four bits in the significand, three bits for the exponent, and one for the sign. The exponent is stored in excess-3 format and all exponent...
-
The Hamming distance between two integers is the number of places where their corresponding bits differ. For example, the Hamming distance between 1011 and 0010 is 2 because the numbers differ in...
-
Write a function to reverse the bits of an unsigned 8-bit integer.
-
Using the table method, convert 6502 to binary.
-
1) Certain elements of culture have a significant influence on the international negotiation process. Describe four. 2) What integration difficulties do people who immigrate to Quebec experience? 3)...
-
Tanaka Company's cost and production data for two recent months included the following: March April Production (units).........300................600 Rent.....................$1,800............$1,800...
-
What is the lost income from unoccupied rooms at the Grosvenor Hotel?
-
Discuss the activities associated with initiating an enterprise data warehouse (EDW) project.
-
Compare and contrast the tuple relational calculus with domain relational calculus. In particular, discuss the distinction between tuple and domain variables.
-
Costless Group has a subsidiary in France, ABC Stores. ABC Stores beginning and ending trial balances, in its functional currency, the euro, are below. Additional information (in thousands): 1. Plant...
-
Suppose that on January 1, 2017, La-Z-Boy Inc. established a subsidiary in Ireland, La-Z-Boy Ireland, to design, manufacture and distribute specialized furniture in the European market. Its condensed...
-
Costsave Corporation, a U'S. company, acquired Denner, a discount supermarket chain in Switzerland, on J anuary 1, 2017. Denner is a subsidiary of Costsave, and its results are consolidated with...
Study smarter with the SolutionInn App