Question 1: BookList (30 marks) While writing your answer to question 1 make use of BookMain...
Fantastic news! We've Found the answer you've been seeking!
Question:
Transcribed Image Text:
Question 1: BookList (30 marks) While writing your answer to question 1 make use of BookMain to test your solutions to the various parts of the question. This class won't be marked. You will also use the Book and BookCollection classes in this question. 1. Complete the Book class. It should have the following private properties. You class should include a constructor with arguments for each of these properties. Also create getters and setters for each property title (string) author (String) ISBN (long) pages (int) copiesAvailable (int) copiesOnLoan (int) [2 marks] 2. Complete the BookCollection constructor so that it loads the file path argument as a File. Then use a Scanner to read in the file and populate the books arrayList. When complete books should have 100 items in it. Hint: You will need to skip over the first line of the file (the column headers), otherwise you will get an error. [6 marks] 3. Complete the function getAuthors so that it returns a HashSet of all the authors in books. [5 marks] 4. Complete the function getLongBooks so it returns an ArrayList of Books which have over 750 pages in them [5 marks] 5. Complete the function getBookBy Title so it returns the Book object for the given title. If a title not in the list is given return null. [5 marks] 6. Complete the function getMost PopularBooks which returns an array of the 10 most popular books (That is those that currently have most copies on loan). [7 marks] Question 1: BookList (30 marks) While writing your answer to question 1 make use of BookMain to test your solutions to the various parts of the question. This class won't be marked. You will also use the Book and BookCollection classes in this question. 1. Complete the Book class. It should have the following private properties. You class should include a constructor with arguments for each of these properties. Also create getters and setters for each property title (string) author (String) ISBN (long) pages (int) copiesAvailable (int) copiesOnLoan (int) [2 marks] 2. Complete the BookCollection constructor so that it loads the file path argument as a File. Then use a Scanner to read in the file and populate the books arrayList. When complete books should have 100 items in it. Hint: You will need to skip over the first line of the file (the column headers), otherwise you will get an error. [6 marks] 3. Complete the function getAuthors so that it returns a HashSet of all the authors in books. [5 marks] 4. Complete the function getLongBooks so it returns an ArrayList of Books which have over 750 pages in them [5 marks] 5. Complete the function getBookBy Title so it returns the Book object for the given title. If a title not in the list is given return null. [5 marks] 6. Complete the function getMost PopularBooks which returns an array of the 10 most popular books (That is those that currently have most copies on loan). [7 marks]
Expert Answer:
Related Book For
The Economics Of The Environment
ISBN: 9780321321664
1st Edition
Authors: Peter Berck, Gloria Helfand
Posted Date:
Students also viewed these programming questions
-
You are a tax preparer and have been asked to complete the previous year's tax return for new client Gabriel and Sophie Dubois. Because the Dubois children, Jean and Juliette, are now in college or...
-
Q1. You have identified a market opportunity for home media players that would cater for older members of the population. Many older people have difficulty in understanding the operating principles...
-
Murray Company has provided the following partial comparative balance sheets and the income statement for 2010. Required: Compute operating cash flows by using the indirectmethod. Murray Company...
-
Consider a redox reaction for which E is a negative number. (a) What is the sign of G for the reaction? (b) Will the equilibrium constant for the reaction be larger or smaller than 1? (c) Can an...
-
a) Write short notes on the following fundamental concepts of microeconomics: (i) Scarcity and Choice (ii) Opportunity cost (iii) Production possibility frontier (iv) Positive and normative economics...
-
A used conveyor dealer presents an investment package that requires you to pay $\$ 189.99$ a month with $\$ 1,499.00$ down and a nominal annual interest rate of $17 \%$. What is the actual cost of...
-
Mr. Fresser, age 67, owns 80% of the common shares of Fresser Ltd., a CCPC. The other 20% is owned by his daughter, Elana, who has worked in the business with Mr. Fresser for the past 22 years. When...
-
o Value An economist for a sporting goods company estimates the revenue and cost functions for the production of a new snowboard. These functions are R(x) = -x+ 15x and C(x)=7x+12, respectively,...
-
Let F(s)=1.1s+0.03s2 represent the stopping distance (in feet) of a car traveling at smiles per hour. Calculate F(35) and estimate the increase in stopping distance if speed is increased from 35 to...
-
Advertising is an important part of marketing, but mass advertising, which is generally despised by many people around the world, is more and more becoming an ancient way of doing business. Today,...
-
When Walmart started to expand internationally in the early 1990s, the company set up an international division to oversee the process. The international division was based in Bentonville, Arkansas,...
-
Which of the growth strategies discussed in the chapter are the most risky? Which are the least risky? What role should risk play in a companys decision to pursue a particular growth strategy?
-
Procter & Gamble (P&G) is the worlds leading manufacturer of consumer products. P&G, founded in 1837 by British American William Procter and Irish American James Gamble, is headquartered in...
-
The World Investment Report published annually by UNCTAD provides a summary of recent trends in FDI, as well as quick access to comprehensive investment statistics. Identify the table of largest...
-
On a scatter plot in which we plan to develop a regression-based forecast, a smattering of points shows a pattern of a relationship between the x and y variables. Specifically, when x tends to...
-
A fuel pump sends gasoline from a car's fuel tank to the engine at a rate of 5.88 10-2 kg/s. The density of the gasoline is 735 kg/m3, and the radius of the fuel line is 3.18 10-3 m. What is the...
-
Steam at \(1,000 \mathrm{kPa}\) and \(300^{\circ} \mathrm{C}\) enters an engine and expands to \(20 \mathrm{kPa}\). If the exhaust steam has a dryness fraction of 0.9 , make calculations for the drop...
-
Combined separating and throttling calorimeter is used to find out dryness fraction of steam, following readings were taken: Main pressure \(=12\) bar abs. Mass of water collected in separating...
-
Determine the quality of steam for the following cases: (i) \(P=10\) bar, \(v=0.180 \mathrm{~m}^{3} / \mathrm{k}\) (ii) \(P=10\) bar, \(t=200^{\circ} \mathrm{C}\) (iii) \(P=25 \mathrm{bar}, h=2,750...
Study smarter with the SolutionInn App