Data Structures and Algorithms in Java
6th Edition
ISBN: 9781118771334
Author: Michael T. Goodrich
Publisher: WILEY
expand_more
expand_more
format_list_bulleted
Expert Solution & Answer
thumb_up100%
Chapter 2, Problem 16C
Explanation of Solution
Initial considerations:
Normally, the E-book shop contains a variety list of books from which the customers places an order based on their favor.
The following architecture is not the absolute design for “e-book reader” architecture. It is the assumption and it includes variety of classes to follow the inheritance property.
Primary classes and methods:
The primary classes and the methods of E-book reader that the java software required are as follows:
- “E-bookshop”, “Customer”, “Order”, “ItemOrder”, and “Item”.
- E-bookshop contains the methods getDownloadURL() and getsizeMB().
- getDownloadURL() is used to download the site of the book that the customer needs to purchase.
- getsizeMB() is used to know the size of the book in bytes.
- Customer class contains the method Customer()
- This method is to retrieve the details of customer.
- Order class contains the method Order().
- This method places the shipping details of order.
- ItemOrder class contains the method ItemOrder()
- This method used to get the number of order that the customer wants to place before purchasing.
- Item class contains no method but is generalized into three sub classes such as Book, MusicCD, and Software.
- The Book class contains the method Book() which is used to order the specific book based on author name.
- The MusicCD class contains the method MusicCD() which is used to order the CD’s based on the artist collections.
- The Software class contains the method Software() which is used to download the book based on the version.
Inheritance diagram for “E-book reader”:
Inheritance diagram is drawn from parent class to child class...
Expert Solution & Answer
Want to see the full answer?
Check out a sample textbook solutionStudents have asked these similar questions
Your task is to develop a Tic-Tac-Toe (also called as “Noughts and Crosses”) game in Java using Swing.
In this assignment, you are asked to implement a single-player version of the Tic-Tac-Toe game with easy-to-use graphical user interface (GUI). One player will be the user and the second player will be artificial intelligence (AI), namely, the computer. The entire procedure of the implementation has been split into three tasks with detailed description and explanation provided. By completing the three tasks, you will develop your own Tic-Tac-Toe game.
Task 1: GUI ImplementationPlease implement a GUI satisfying the following requirements.• A menu bar with two buttons “Reset” and “Quit”. User can click the “Reset” button to restore the software to the initial status. User can software the game by clicking the “Quit” button;• The top pane is an information board to display username and present some basic guidance to the user about this game. The information board will also print out the…
Using the class diagram in the image below, create customer, car, and parking lot classes for an object-oriented parking system. Classes should contain properties and method implementations. Use java to write your code. Add some attributes and methods of your own not included inside the class diagram
Include a 200-word write-up to describe your implementation details and add screenshots of your code and output
Your assignment for this course is to implement a beginner level Book Management System (BMS) in Java language. BMS contains 2 classes: Bookand BookList. The Book class has the following attributes:
code: a String object, that hold the book’s code.
title: a String object, that hold the book’s title.
qua: int variable, that hold the number of books with the same code in the library.
price: a double variable, that hold the book’s price.
The BookList class contains only one data member: ArrayList<Book> t. When running the program display the menu as below:1. Input & add book(s) to the end.2. Display all books.3. Search a book for given code.4. Update the book’s price for given code.5. Find the (first) max price value.6. Sort the list ascendingly by code.7. Remove the book having given code.8. Load data from file.0. Exit.Notes:(1) The book’s code must be unique in the list.(2) Display all books in format (code, title, quantity, price).(5)…
Chapter 2 Solutions
Data Structures and Algorithms in Java
Ch. 2 - Give three examples of life-critical software...Ch. 2 - Give an example of a software application in which...Ch. 2 - Prob. 3RCh. 2 - Prob. 4RCh. 2 - Prob. 5RCh. 2 - Give a short fragment of Java code that uses the...Ch. 2 - Prob. 7RCh. 2 - Prob. 8RCh. 2 - Prob. 9RCh. 2 - Prob. 10R
Ch. 2 - Prob. 11RCh. 2 - Draw a class inheritance diagram for the following...Ch. 2 - Prob. 13RCh. 2 - Prob. 14RCh. 2 - If the parameter to the makePayment method of the...Ch. 2 - Prob. 16CCh. 2 - Most modern Java compilers have optimizers that...Ch. 2 - The PredatoryCreditCard class provides a...Ch. 2 - Modify the PredatoryCreditCard class so that a...Ch. 2 - Prob. 20CCh. 2 - Write a program that consists of three classes, A,...Ch. 2 - Prob. 22CCh. 2 - Prob. 23CCh. 2 - Write a Java class that extends the Progression...Ch. 2 - Redesign the Progression class to be abstract and...Ch. 2 - Use a solution to Exercise C-2.25 to create a new...Ch. 2 - Use a solution to Exercise C-2.25 to reimplement...Ch. 2 - Write a set of Java classes that can simulate an...Ch. 2 - Write a Java program that inputs a polynomial in...Ch. 2 - Write a Java program that inputs a document and...Ch. 2 - Prob. 31PCh. 2 - Write a Java program that simulates a system that...Ch. 2 - Define a Polygon interface that has methods area()...Ch. 2 - Prob. 35PCh. 2 - Write a Java program that can make change. Your...
Knowledge Booster
Similar questions
- Below we have class diagrams with three classes for a simple java based parking management class. Use the classes below to write java code for classes :a parking observer class (that implements an observer pattern) , a transaction manager class and a parking lot class(subject to the observer). Use the class diagram and java class to implement it. You should use an observer pattern to implement your code.The main goal is to implement the following - Once a car enters (in an entry-scan only lot) or leaves (in an entry-scan and exit-scan lot), then the ParkingObserver will be updated, and then can register the charge with the parking system via the TransactionManager’s park() methodarrow_forwardI'm developing a card game that requires one deck of 52 cards using Java. The 52 card has 4 suits from top to bottom: diamonds (d), clubs (c), hearts (h), and spades (s). Each card has a point. The rest of the instructions are in the images. You may add classes to support inheritance, association, aggregation, composition, or any significant features. I just need help to program the sorting of the 5 cards at a player, and the calculation of highest points. The rest of the coding is not needed.arrow_forwardFor this project, you will implement an email client-server simulator using the object-oriented design diagramed below. The class diagram above shows class attributes (members) and methods (operations). Operations are denoted with a plus. The diamonds indicate an aggregation relationship between the connected classes. For example, a mailbox list can have one or many mailboxes. A Mailbox can have one or many messages. You will therefore need data structures container objects (lists) to contain these types of objects, as we have seen in previous exercises. All class attributes are private unless denoted otherwise and therefore must be accessed with constructors. getters, ord setters. Constructors are a preferred way to set class attributes. Constructors, setters, getters, and toString methods can be generated by IntelliJ. Check the IntelliJ documentation for how to use the Generate feature. Messages are simultaneously sent and received. Therefore, a Message is…arrow_forward
- answers all questions and code using javaarrow_forwardCreate a UML class hierarchy (three connected UML diagrams) that has all three classes youcreated above. Make sure each UML diagram is a one-to-one to the code, it matches the Javacode exactly. Make sure that both Child Classes point to their Parent.Hint: your subclasses are siblings.Hint: You need to create three UML diagrams for three created Java classes and connect themusing arrows, where each Child Class points to its Parent. You can either draw this by hand andtake a picture or use a tool / software of your choice. class Desktop extends Computer { private int width; private int height; public Desktop() { super(); width = height = 0; } public Desktop(String manufacturer, String diskSize, String manufacturingDate, int numberOfCores, int width, int height) { super(manufacturer, diskSize, manufacturingDate, numberOfCores); this.width = width; this.height = height; } public int getWidth() { return width; }…arrow_forwardCreate a UML class hierarchy (three connected UML diagrams) that has all three classes youcreated above. Make sure each UML diagram is a one-to-one to the code, it matches the Javacode exactly. Make sure that both Child Classes point to their Parent.Hint: your subclasses are siblings.Hint: You need to create three UML diagrams for three created Java classes and connect themusing arrows, where each Child Class points to its Parent. You can either draw this by hand andtake a picture or use a tool / software of your choice. class Desktop extends Computer { private int width; private int height; public Desktop() { super(); width = height = 0; } public Desktop(String manufacturer, String diskSize, String manufacturingDate, int numberOfCores, int width, int height) { super(manufacturer, diskSize, manufacturingDate, numberOfCores); this.width = width; this.height = height; } public int getWidth() { return width; }…arrow_forward
- We would like to design a software system so that ... we can easily add new functionality without large changes in our software design or code-level implementation. we can easily add or remove easily new functionality without large changes in our software design or code-level implementation. we can easily modify the existing functionality without large changes in our software design or code-level implementation. we can easily use the software system in different scales, i.e., create more or less instances of classes. we can do all of the above.arrow_forwardDesign ADT for a cave and a cave system. An archeologist should be able to add a newly discovered cave to a cave system and to connect two caves together by a tunnel. Duplicate caves—based on GPS coordinates—are not permitted. Archeologists should also be able to list the caves in a given cave system. Specify each ADT operation by stating its purpose, describing its parameters, and writing a pseudocode version of its header. Then Java interface for a cave's methods and one for the methods of a cave system. Include javadoc-style comments in your code. Java programarrow_forwardExplain why you think interfaces are better than abstract classes in your opinion.arrow_forward
- This next program is a little simpler, but it still illustrates some very critical program structures. It also illustrates an idea that is still used commonly, even if the mechanism has evolved with modern tools and alternative languages. We are referring to a menu-based help system. Modern help systems and menus are often represented using an integrated user environment; however, the core concepts behind the help system remain largely unchanged from this assignment. Create an interactive help system for Java programming. The system will incorporate a menu system that interacts with the user, and the appropriate help topic will be displayed, based on an input selection. This program is going to require some research on your part, as well as some programming in Java. Specifically, you will need to find definitions for the Java terms included in your help system. You can read the textbook or scour the Internet for the definitions. They should be no more than a few sentences each; nothing…arrow_forwardThis next program is a little simpler, but it still illustrates some very critical program structures. It also illustrates an idea that is still used commonly, even if the mechanism has evolved with modern tools and alternative languages. We are referring to a menu-based help system. Modern help systems and menus are often represented using an integrated user environment; however, the core concepts behind the help system remain largely unchanged from this assignment. Create an interactive help system for Java programming. The system will incorporate a menu system that interacts with the user, and the appropriate help topic will be displayed, based on an input selection. This program is going to require some research on your part, as well as some programming in Java. Specifically, you will need to find definitions for the Java terms included in your help system. You can read the textbook or scour the Internet for the definitions. They should be no more than a few sentences each; nothing…arrow_forwardTASK Design the Java classes named Shape, Rectangle and Point by taking into account the following UML diagram: Write a Test dass to verify your implementation. Shape -color: String -location : Point +Shape(String) +getX(): double +getY() : double +setLocation(double,double) : void +getColor(): String +setColor(String): void +Print() : void Circle Point +radius: double +setCenter(double,double): void +getCenter () : Point +setColor (String): void +getColor(): String +Print() : void +Circle(double) -x: double -y: double +getX(): double +setX): void +getY() : double +setY() : void +Print() : void Rectangle '+width : double +height : double +getCornerLeftLow() : Point +getCornerleftUpp: Point +getCornerRightLow() : Point +getCornerRightUpp() : Point +setLocation(double, double) : void +setColor(String): void +getColor() : String +getArea() : double +Print() : void +Rectangle(double,double) NOTES: (1) The location of a Rectangle object is defined as its lower left corner and the location…arrow_forward
arrow_back_ios
SEE MORE QUESTIONS
arrow_forward_ios
Recommended textbooks for you
- Database System ConceptsComputer ScienceISBN:9780078022159Author:Abraham Silberschatz Professor, Henry F. Korth, S. SudarshanPublisher:McGraw-Hill EducationStarting Out with Python (4th Edition)Computer ScienceISBN:9780134444321Author:Tony GaddisPublisher:PEARSONDigital Fundamentals (11th Edition)Computer ScienceISBN:9780132737968Author:Thomas L. FloydPublisher:PEARSON
- C How to Program (8th Edition)Computer ScienceISBN:9780133976892Author:Paul J. Deitel, Harvey DeitelPublisher:PEARSONDatabase Systems: Design, Implementation, & Manag...Computer ScienceISBN:9781337627900Author:Carlos Coronel, Steven MorrisPublisher:Cengage LearningProgrammable Logic ControllersComputer ScienceISBN:9780073373843Author:Frank D. PetruzellaPublisher:McGraw-Hill Education
Database System Concepts
Computer Science
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:McGraw-Hill Education
Starting Out with Python (4th Edition)
Computer Science
ISBN:9780134444321
Author:Tony Gaddis
Publisher:PEARSON
Digital Fundamentals (11th Edition)
Computer Science
ISBN:9780132737968
Author:Thomas L. Floyd
Publisher:PEARSON
C How to Program (8th Edition)
Computer Science
ISBN:9780133976892
Author:Paul J. Deitel, Harvey Deitel
Publisher:PEARSON
Database Systems: Design, Implementation, & Manag...
Computer Science
ISBN:9781337627900
Author:Carlos Coronel, Steven Morris
Publisher:Cengage Learning
Programmable Logic Controllers
Computer Science
ISBN:9780073373843
Author:Frank D. Petruzella
Publisher:McGraw-Hill Education