Question

In: Computer Science

XYZ holdings have many branches. Each branch has a name and is located in a different...

XYZ holdings have many branches. Each branch has a name and is located in a different province.
Each branch has several departments such as marketing, finance, sales and customer relations.
For a department to exist there must be employees employed in each of the departments.
An employee is ether a permanent staff member or a temporary staff member. The difference
between these two types of employees exist in the facts that permanent staff earns a fixed salary
of R30 000 every month and has a medical aid benefit whereas temporary staff members has an
hourly rate of R400 per hour and their monthly salary is dependent on the number of hours
worked each month multiplied by their hourly rate. Temporary staff members also do not have a
medical aid benefit. All employees, however, have a name, surname and employee number.

Q.2.1 Write the pseudocode for class TemporaryEmployee. Also, ensure that you
indicate the relationship between the TemporaryEmployee and Employee
class.
(17)
Q.2.2 Using pseudocode, write the mainline logic that will make use of the
appropriate methods in the TemporaryEmployee class to calculate the monthly
salary of a temporary employee. Your mainline logic should prompt the user
for the values needed.

Java programming
Logic and Design

Solutions

Expert Solution

package learning;
import java.util.*;

class Employee{
        String name;
        String surname;
        String employeeNumber;
}


class TemporaryEmployee extends Employee{
        int hoursWorked;
        static boolean medicalAid=false;
        
        TemporaryEmployee(int hours){
                hoursWorked = hours;
        }
        
        int salary() {
                return 400*hoursWorked;
        }
}
class Main {
        
        public static void main(String[] args) {
                
                Scanner input = new Scanner(System.in);
                
                System.out.print("Enter the number of Hours worked: ");
                
                int hours = input.nextInt();
                
                TemporaryEmployee E1 = new TemporaryEmployee(hours);
                
                System.out.println("Salary: " + E1.salary());
                
        }
}

OUTPUT:


Related Solutions

XYZ holdings have many branches. Each branch has a name and is located in a different...
XYZ holdings have many branches. Each branch has a name and is located in a different province. Each branch has several departments such as marketing, finance, sales and customer relations. For a department to exist there must be employees employed in each of the departments. An employee is ether a permanent staff member or a temporary staff member. The difference between these two types of employees exist in the facts that permanent staff earns a fixed salary of R30 000...
Scenario to be used for question :: XYZ holdings have many branches. Each branch has a...
Scenario to be used for question :: XYZ holdings have many branches. Each branch has a name and is located in a different province. Each branch has several departments such as marketing, finance, sales and customer relations. For a department to exist there must be employees employed in each of the departments. An employee is either a permanent staff member or a temporary staff member. The difference between these two types of employees exist in the facts that permanent staff...
Name the two branches of the autonomic nervous system, describe the function of each branch, and...
Name the two branches of the autonomic nervous system, describe the function of each branch, and state the changes that occur in various target organs during the "fight-or-flight" response.
3) ABC bank has many branches; XYZ bank has relatively few branches. Both banks are the...
3) ABC bank has many branches; XYZ bank has relatively few branches. Both banks are the same size - $100 billion in assets - and operate in a five state region. Compare/contrast likely differences in the expenses incurred by ABC relative to XYZ. 4) a) What are the reasons for “consolidation” of the financial services industry? b) When a low-risk firm combines with a high-risk firm, what can we say about the risk of the conglomerate relative to that of...
Identify the separation of powers between the three branches of government. Then, discuss how each branch checks and balances the other branches.
Write a 1,050- to 1,400-word essay that addresses the following: Identify the separation of powers between the three branches of government. Then, discuss how each branch checks and balances the other branches. Select and discuss a current event or issue from the past 5 years (possible areas include: health care reform, presidential appointments, and national security, for example). Then, discuss 1) how the separation of powers affects this issue and 2) how the checks and balances affects this issue.
1) Smart Driver Driving School has many branches across provinces. In a province different from the...
1) Smart Driver Driving School has many branches across provinces. In a province different from the one in problem 1, the teaching committee at the provincial branch randomly assigned half of their 5000 students enrolled this year to receive the conventional teaching method and the remaining half to receive the new teaching method. In a random sample of 100 students who received the conventional teaching method, 76 passed the road test. In another random sample of 100 students who received...
A bank with a branch located in a commercial district of a city has developed an...
A bank with a branch located in a commercial district of a city has developed an improved process for serving customers during the noon-to-1 P.M. lunch period. The bank has the business objective of reducing the waiting time (defined as the number of minutes that elapse from when the customer enters the line until he or she reaches the teller window) to increase customer satisfaction. A random sample of 15 customers is selected and waiting times(in minutes) are collected and...
A bank with a branch located in a commercial district of a city has the business...
A bank with a branch located in a commercial district of a city has the business objective of improving the process for serving customers during the noon-to-1 PM lunch period. To do so, the waiting time (defined as the number of minutes that elapses from when the customer enters the line until he or she reaches the teller window) needs to be shortened to increase customer satisfaction. A random sample of 15 customers is selected and the waiting times were...
A bank with a branch located in a commercial district of a city has developed an...
A bank with a branch located in a commercial district of a city has developed an improved process for serving customers during the noon to 1 P.M. lunch period. The waiting time (operationally defined as the time elapsed from when the customer enters the line until he or she reaches the teller window) of all customers during this hour is recorded over a period of one week. A random sample of 15 customers is selected, and the results (in minutes)...
A bank with a branch located in a commercial district of a city has the business...
A bank with a branch located in a commercial district of a city has the business objective of improving the process for serving customers during the noon-to-1 pm lunch period. To do so, the waiting time (defined as the number of minutes that elapses from when the customer enters the line until he or she reaches the teller window) needs to be shortened to increase customer satisfaction. A random sample of 15 customers is selected and the waiting times are...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT