Create a class with the given information in the overview

Assignment Help Computer Engineering
Reference no: EM132192989

Write an application that simulates adding new books to the Amazon database.

The Application repeatedly asks the information of a new book and once the information is gathered, it will be displayed to the user. Note that this application does not save the information of the book.

Information of the book includes its title, author, the number of ratings, the sum of all the rating (the rating given to a book is 1 or 2 or 3 or 4), its price and whether the book has a hardcover or not.

When adding a new book, the user can choose to provide only the book title and its author. The rest of the information will be set to default values by the program: Price to random number between 1 and 10, the number of ratings and the sum of ratings to 0 and no hardcover for the book.

The user can also choose to enter all the book's information.

A book can have 0 or more than one rating. Rating given to a book is a number between 1 (lowest) and 4 (highest). The number of ratings and the total will be saved in the book's information.

After information is entered for the book, it will be displayed to the user. The program will also display a recommendation information for the book based on its average rating: If the average rating is between 3 and 4, the book is strongly recommended, between 2 and 3 is recommended, between 1 and 2, not recommended and if there is no rating then no information is available for recommendation.

Specifications & Requirements

Design and implement a Java application to satisfy the specified high level requirements from the Overview section. The system is required to do the following:

Data Element Class - Book

Create a class with the given information (fields) in the overview section.

Create a constructor that takes book's title and author and creates a book instance with the provided information. The number of ratings, Total rating will be set to zero, price is set to random number between 1 and 10 and the book has not hardcover.

Create another constructor that takes the information for the title, author, price and whether the book has hardcover or not and creates a book instance with the given information. The number of ratings, Total rating will be set to zero.

A method addRating that takes the rating for the book and adds it to the total rating as well as incrementing the number of ratings for this book.

A method called findAvgRating that returns the average rating for this book or 0 if there is no rating for the book.

A method called bookRecommendation that returns a string based on the average rating of the book. The book is "strongly recommended" for average rating between 3 and 4, "Recommended" for average rating between 2 and 3(exclusive) , "Not Recommended" for average rating between 1 and 2 (exclusive) , and if there is no rating return "No Information Is Available For Recommendation".

A toString method that returns the string representation of a Book object: title, author, number of ratings, average rating, price and book recommendation.

Add any necessary getter or setter methods.

Driver Class - Amazon

This is the driver class for Book that contains a main method.

Create a method getInput() that returns a Book object. This method allows the user to enter book information, uses the information to construct a Book object and returns it.

This class contains a main method which continues asking the book information as long as user chooses to enter more information and displays the information of the book to the user. Refer to the program sample run for more clarification.

Add any necessary methods to modularize your code.

Reference no: EM132192989

Questions Cloud

Wanted the margin of error : If the Pew researchers had wanted the margin of error (at the 95% confidence level) to be only 3% (0.03) instead of 4%, what sample size should they have used?
What is the efficiency class of this algorithm : Write an algorithm in pseudocode to perform the multiplication of a n cross n matrix A with a n cross 1 vector b.
Display the students name and the average of the grades : Write the Algorithm (not the program) for the following problem. A program needs get the following data from the user:
How large a sample would we have needed : If we wanted to estimate µ with 99% confidence interval with a margin of error of 2000, how large a sample would we have needed?
Create a class with the given information in the overview : Write an application that simulates adding new books to the Amazon database. Create a class with the given information in the overview section.
State the decision rule and compute the test statistic : At a=0.05, does this sample data indicate a difference from the national proportion? State the decision rule and compute the test statistic.
Write a driver class that maintains lists of students : Write an application in java that models courses, students, and faculty members in a university.
State the hypothesis and the decision rule : At a=0.01, can the inspector claim that the mean weight is less than 16 ounces? State the hypothesis and the decision rule (using the critical value).
How large a sample size is necessary : A researcher wants to be 99% confident that his proportion is within 4% of the true proportion. How large a sample size is necessary?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd