Академический Документы
Профессиональный Документы
Культура Документы
TASK 1 (5 POINTS)
Create an application that defines a public class and contains a read only auto-implemented property, a
method override and constructors. During instantiation, call the parametric and not parametric versions,
too. The class and object diagrams to be implemented can be seen below:
Class Diagram
class zh1a_1_App
Person
+ Person()
+ Person(name: string)
+ ToString(): string Name: Name
«property»
+ Name(): string
Object Diagram
analysis Business Process ... analysis Business Process Model
«property» «property»
+ Name(): string + Name(): string
Output
unknown
Wesley Morris
Wesley Morris
TASK 2 (8 POINTS)
Create an application that stores and processes the data of employees. Regarding the “generalized”
employees, their names and base salaries have to be stored. A “special” branch of the employees is the
sales employees, who can get bonus benefits besides their base salary, so in case of calculating their full
salary, in contrast to the “generalized” employees, this amount has to be taken into account. Both the
“generalized” and the “specialized” employees pay tax on earnings. As the income tax is independent of
the amount of the salary (flat tax), apply it in this case as well. The income tax is the 8% of the salary.
During instantiation, create at least two (Employee and SalesEmployee) objects. The class and object
diagrams to be implemented can be seen below:
Class
class Diagram
zh1a_2_App
Employee
SalesEmployee
Object Diagram
analysis Business Process Model
analysis Business Process ...
employee1 : SalesEmployee
employee2 : Employee
# basepay: decimal = 800
+ name: string = Billy # basepay: decimal = 600
- salesbonus: decimal = 300 + name: string = Helen
Output
"Employee#1 Billy earned: 1100; taxes: 88,00"
"Employee#2 Helen earned: 600; taxes: 48,00"
Create an application to implement a list of hospital persons. Store the identifier, type, gender. last and
first name, birth of date, address and phone number in the cases of all persons. The application must be
able to provide basic, valid information about all persons. There are two specialized types of the persons:
the patient and the doctor. Store further data in case of these two types: in case of the patient, store the
data of hospital admission, actual sickness and possible allergies, while in case of the doctor, store the
place of graduation, spoken languages and acquired specializations. Your further task is to implement the
methods required by the interface and ensure the opportunity both in case of the patient and the doctor
to give their age. During instantiation, collect the doctors and the patients in lists, then save the data of
the lists in separate text files in the way that each column is separated by the „ ; ” character (patients.txt
and doctors.txt) If there can be more values in a column, e. g. in case of allergies, separate them with a
comma. The phone numbers should be generated in ##/## ###-### form. The data of the persons
should be uploaded randomly, implement a separate class to do this. Create at least 100 persons. During
instantiation, decide applying polymorphism, if somebody is a doctor or a patient. Further details can be
read from the UML diagrams. A possible output is found next to the task description.
class zh1a_3_App