QUESTION 1 (10 MARKS) Given the following information for Medical class and its subclass, Specialist. Class name: Medica
Posted: Thu Jul 14, 2022 2:10 pm
QUESTION 1 (10 MARKS) Given the following information for Medical class and its subclass, Specialist. Class name: Medicaldoctor Attributes: String id, String name, double basicsalary Methods: constructors, mutator, retriever, processor, printer Subclass name: Specialist Attributes: String specialtyArea, int consultationtime; Methods: constructors, mutator, retriever, processor, printer a) Write the following methods. i. The normal constructor for Specialist subclass. (1.5 marks) ii. Method calcconsultationsalary () in Specialist class that will calculate the consultation fees the doctor will receive and return a double value. (3.5 marks)
D) In the main method i. Create an array of objects with type Specialist named specialist. The array size is 100 . (1 mark) ii. Assume that 100 specialists" information have been stored inside the array specialist. Count and display the number of specialists in gynecologist. (2 marks) iii. Using the same array, calculate and display the total salary of all specialist doctors. The total salary for a specialist is the basic salary together with the consultation fees. (2 marks)
D) In the main method i. Create an array of objects with type Specialist named specialist. The array size is 100 . (1 mark) ii. Assume that 100 specialists" information have been stored inside the array specialist. Count and display the number of specialists in gynecologist. (2 marks) iii. Using the same array, calculate and display the total salary of all specialist doctors. The total salary for a specialist is the basic salary together with the consultation fees. (2 marks)