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

  At what airspeed does direct cooling become impossible

An aircraft oil cooler is to be constructed using the skin of the wing as the cooling surface. The wing may be idealized as a flat plate over which air.

  Display the customers company name

Display the customers company name, address, city, region, employee last name, order ID and the order date for orders.

  Implementing the stack using dynamically allocated array

Write down the C++ class which implements the stack utilizing the dynamically allocated array. The initial size of the particular stack must be evaluated when it is generated.

  What are the possible consequences if you fail to identify

What does a physical DFD represent? How do data stores in the physical DFD differ from the data stores in the logical DFD? Give an example.

  Create the logic for a program that continuously prompts

The application passes the value in turn to a method that computes the sum of all the whole numbers from 1 up to and including the entered number, and to a method that computes the product of all the whole numbers up to and including the entered n..

  Why is it important to match the user interface to the task

Why is it important to match the user interface to the task? Explain. How does simplicity affect accuracy in good form design? Explain.

  What are the business interests of organized crime groups

what are the business interests of organized crime groups? how have these interests evolved over time? how would you

  The file you should encode the contents of the array

When you get to the end of the file you should encode the contents of the array with a Vigenère cipher using the keyword CRYPTOGRAM, then print it out.

  Modify the program so that the balance after each year

How many years does it take for the investment to triple? Modify the program so that the balance after each year is printed. How did you do that?

  Write all appropriate connectivities and cardinalities

The diagram must include all entities, attributes, and relationships. Primary keys and foreign keys must be clearly identified on the diagram.

  What is the greatest magnitude negative number

What is the largest positive number one can represent in an 8-bits 2's complement code? Write your result in binary and decimal.

  Design a verilog module to convert a 64-bit data signal

Design a Verilog module to convert a 64-bit data signal with periodic timing (eight-cycle period) into a series of eight-bit signals with periodic timing.

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