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
Use java programming properties to write all the necessary classes and/or interfaces for a solution to the problem. Focus on class structure and interaction. You may implement your solution however you wish, but you will be graded on the appropriateness of your solution to the requirements. Note the use of capitalization and parentheses for clarification. You may use whatever constructors or additional methods you wish.
Define a structure that can represent Animals. Animals have two behaviors; they can speak() and they can move(). By default, when an animal moves, the text ”This animal moves forward” is displayed. By default, when an animal speaks, the text ”This animal speaks” is displayed. A general Animal should not be able to be instantiated. Define two classes, Goose and Lynx, that are Animals. Both Goose and Lynx behave such that where “Animals” is displayed in speak() or move(), “goose” or “lynx” is displayed by the appropriate classes. Finally, any instance of Goose can fly(),…
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
- 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)…arrow_forwardBelow 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_forward
- For 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_forwardjava Design a class to represent a credit card. Think about the attributes of acredit card; that is, what data is on the card? What behaviors might bereasonable for a credit card? Use the answers to these questions to write aUML class diagram for a credit card class. Then give three examples ofinstances of this class.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_forward
- TASK 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_forwardImplement a simple e-mail messaging system. A message haarrow_forwardCan somone help me with a class and case diagram for the following: Euro Rail want a new implementation of their ticket sales software written in Java. They are not interested in the web interface or the vending machines, but want to consider the customer, the customer's journey, and the type of ticket that the customer will need to purchase.arrow_forward
- Draw a System Diagram of a GUI Checkers game (Java) where the player can choose to play either against player 2 or CPU.arrow_forwardWhy is it not possible to implement the multiple inheritance in Java? How do you solve that problem? Give at least one example that describes a way to implement the multiple inheritance using an interface.arrow_forwardPlease help me design a SimulationProject.cpp in C++. THANK YOU! For this assignment, we will simulate boarding procedures for Airworthy Airlines. The Airline's current procedure is as follows: pre-board in the following order: families with young children or people who need help (e.g., wheelchair) first class and/or business class passengers elite passengers (frequent fliers) and those passengers seated in exit rows conduct general boarding in reverse, from the back of the plane to the front in the following order: rows 23-26 rows 17-22 rows 11-16 rows 5-10 Airworthy is considering revising their boarding procedure such that general boarding is done randomly, meaning the first passenger in line for general boarding is the first passenger to board (i.e., general boarding passengers all have the same priority). Airworthy suspects this random general boarding method will improve the flow of passengers, getting them on board and seated more quickly. It is also less labor-intensive…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