Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

please help with this homework. language is java Question Use inheritance and polymorphism to solve a real-world system development problem. 1. Pretend that there is

please help with this homework. language is java
image text in transcribed
image text in transcribed
Question Use inheritance and polymorphism to solve a real-world system development problem. 1. Pretend that there is a business in the real world and the owner asks you to design a system for it, examples like: a Library, a Restaurant, a Zoo, a Sport Team, a GroceryStore, ete. 2. Your project must contain: a 3-layer hierarchy of Classes that satisfy the owner's requirement. Each class in the first and second layer needs at least 2 subclasses. - Example: in a bank project, a Product class could have 2 subclasses: A Loan class An Account class The Loan class can have 2 subclasses: 1. A Mortgage class 2. A LineOfCredit class The Account class can have 2 subclasses: 1. A Savings class 2. A Checking class = Each class in the hicrarchy should have: -Reasonable properties (data members) Valid access modifiers Valid non-access modifiers - Default constructor - Constructor with data members as parameters - Copy constructor -The method you designed in the Class Diagram (if applicable) - equals -tostring -getters and setters - You have to add at least 3 specific methods in the hierarchy (each layer needs at least 1 ) - Example: Product: void addProductToList(Product p) Mortgage:: double calculate Yearlylnterest(0) Savings:: void calculateNumberOf Payments(double interest, double payments) a XxxxSystem (or Library, Restaurant, Zoo, etc.) class that contains at least one collection of something that is designed in the previous hierarchy (like a Library contains books, a Restaurant contains Dishes, a Zoo contains Animals etc.) 1. Draw a UML Class Diagram of the entire project. (Create a screenshot of it and save it as a .png file or a .jpg file) 2. Translate the UML Class Diagram into Java code. Your code should follow the same structure as defined in the UML. (For some of the methods, to implement the real body could be very difficult, then you can just implement a simplified version of it.)

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning VB 2008 Databases

Authors: Vidya Vrat Agarwal, James Huddleston

1st Edition

1590599470, 978-1590599471

More Books

Students also viewed these Databases questions