Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

DIAGRAMS Part 1 Class Diagram (40 points) Below is a Class Diagram Example, Read and answer the following questions interface Person firstVame: String lastName :

DIAGRAMS

image text in transcribed

Part 1 Class Diagram (40 points) Below is a Class Diagram Example, Read and answer the following questions interface Person firstVame: String lastName : String Professor Student salary Dollars major: Sting (1) Now we extend the given diagram. The Professor class aggregates a Salary class, which has fields named salaryPerHour (Dollars), baseSalary (Dollars), extraWorkingHours (int) and a method called calculateSalary (return Dollars). A class PartTimeStudent inherits the class Student with new fields workplace (String), availability (int) and a method scheduleExam (return String). Revise the class Professor based on the Salary class (hint: change related fields) and give the complete new class diagram including the class Dollars (no need to specify the fields and methods of Dollars). (15 pts) (2) Consider to build a management system for a startup software company. There is a base class Person (which has name, birthday, address, sex and a method printInformation). Then 2 classes inherit Person. First is FullTimeWorker, which has a new field called salary and a new method called printMonthlySalary). The other class is ParttimeWorker, which contains new fields workingHours, hourlySalary with a new method calculateMonthlySalary). Design the type of each class member (i.e. field or method). Then draw the complete class diagram. (25 pts)

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

Students also viewed these Databases questions