Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Translate this UML diagram into a .java file. The file should support revenue earned. Personal Trainer (-) firstName : String (-) lastName : String (-)

Translate this UML diagram into a .java file. The file should support revenue earned.

image text in transcribed

Personal Trainer (-) firstName : String (-) lastName : String (-) salary: double (-) noOfClients : int Name of the data definition class Variable that stores the first name of the Personal Trainer object Variable that stores the last name of the Personal Trainer object Variable that stores the salary of the Personal Trainer object Variable that stores the number of clients of the Personal Trainer object // Accessors (GET) Methods (+) getFirstName(): String (+) getLastName(): String (+) getSalary(): double (+) getNoOfClients():int Retrieves the first name of the Personal Trainer object Retrieves the last name of the Personal Trainer object Retrieves the salary Personal Trainer object Retrieves the number of clients Personal Trainer object //Mutators (SET) Methods (+) setFirstName( firstName : String) : void (+) setLastName( lastName : String) : void (+) setSalary( hourlySalary: double : boolean (+) setNoOfClients noOfClients : int) : boolean Sets the first name of the Personal Trainer object Sets the last name of the Personal Trainer object Sets the salary of the Personal Trainer object Sets the number of clients of the Personal Trainer object //Special Purpose Method (+) calculateRevenue) : double Calculates the revenue of the Personal Trainer object; Should be ($195 times number of Clients) minus the salary

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

Intelligent Information And Database Systems 12th Asian Conference ACIIDS 2020 Phuket Thailand March 23 26 2020 Proceedings

Authors: Pawel Sitek ,Marcin Pietranik ,Marek Krotkiewicz ,Chutimet Srinilta

1st Edition

9811533792, 978-9811533792

More Books

Students also viewed these Databases questions