Question

In: Computer Science

The human resources department for your company needs a program that will determine how much to...

The human resources department for your company needs a program that will determine how much to deduct from an employee’s paycheck to cover healthcare costs. Health care deductions are based on several factors. All employees are charged at flat rate of $150 to be enrolled in the company healthcare system. If they are married there is an additional charge of $75 to cover their spouse/partner. If they have children, the cost is $50 per child. In addition, all employees are given a 10% deduction in the total cost if they have declared to be a “non-smoker”.

Your goal is to create a program that gathers the employee’s name, marital status, number of children and whether or not they smoke tobacco for a single employee. While gathering this information, if the user enters at least one invalid value, the program must display one error message telling the user they made a mistake and that they should re-run the program to try again. The program must then end at this point. However, if all valid values are entered, the program should calculate the total cost of the healthcare payroll deduction and then print a well-formatted report that shows the employee’s name, marital status, total number of children, and smoker designation, and total deduction amount.

Please write a pseudocode for the above problem. Don't forget to validate the inputs as necessary.

Solutions

Expert Solution

// Pseudocode to determine how much to deduct from an employee’s paycheck to cover healthcare costs.

Declaration
   string name, marital_status, smoke_tobacco;
   number children, total_deduction;
  
Start
  
   // input of name
   Print("Enter name : ");
   Input name;
  
   // input of marital status
   Print("Enter Marital Status (M/S) : ");
   Input marital_status;
  
   // validate marital status to be "M" or "S" irrespective of case
   if(marital_status != "M" and marital_status != "m" and marital_status != "S" and marital_status != "s") then
       Print("Invalid value for marital status. Please run the program again"); // print error message
       Exit ; // exit the program
   end if;
  
   // input number of children
   Print("Number of children : ");
   Input children;
  
   // validate number of children cannot be negative
   if(children < 0) then
       Print("Number of children cannot be negative. Please run the program again"); // print error message
       Exit; // exit the program
   end if;

   // input of smoker designation
   Print("Do you smoke(Y/N) : ");
   Input smoke_tobacco;
  
   // validate smoker designation to be "Y" or "N" irrespective of the case
   if(smoke_tobacco != "Y" and smoke_tobacco != "y" and smoke_tobacco != "n" and smoke_tobacco != "N"):
       Print("Invalid value for smoking tobacco. Please run the program again"); // print error message  
       Exit; // exit the program
   end if;

   // calculate total_deduction
   // set total_deduction to flat rate for all employees
   total_deduction = 150;
  
   // check if married then add charge to cover spouse/partner
   if(marital_status == "M" or marital_status == "m") then
       total_deduction = total_deduction + 75;
   end if;

   // add the charge for each children
   total_deduction = total_deduction + 50*children;
  
   // check if employees is not a smoker then deduct 10% from total cost
   if(smoke_tobacco == "n" or smoke_tobacco == "N") then
       total_deduction = total_deduction - (0.1*total_deduction);
   end if;

   // print employees name , marital status, number of children, smoker designation and total deduction amount
   Print("Employee Name : ",name);
   Print("Marital Status(M/S) : ",marital_status);
   Print("Total number of children : ",children);
   Print("Smoker Designation(Y/N) : ",smoke_tobacco);
   Print("Total Deduction Amount : $",total_deduction);
End  
      
  


Related Solutions

The human resources department for your company needs a program that will determine how much to...
The human resources department for your company needs a program that will determine how much to deduct from an employee’s paycheck to cover healthcare costs. Health care deductions are based on several factors. All employees are charged at flat rate of $150 to be enrolled in the company healthcare system. If they are married there is an additional charge of $75 to cover their spouse/partner. If they have children, the cost is $50 per child. In addition, all employees are...
Scenario: The human resources department for your company needs a program that will determine how much...
Scenario: The human resources department for your company needs a program that will determine how much to deduct from an employee’s paycheck to cover healthcare costs. Health care deductions are based on several factors. All employees are charged at flat rate of $150 to be enrolled in the company healthcare system. If they are married there is an additional charge of $75 to cover their spouse/partner. If they have children, the cost is $50 per child. In addition, all employees...
The Human Resources Department of a company conducts a survey to determine if a new medical...
The Human Resources Department of a company conducts a survey to determine if a new medical insurance plan is viewed favorably. Out of 200 employees surveyed 80 said they liked the change.    a. Calculate a 95% confidence interval for the population proportion who view the change favorably. b. What is the proper interpretation of the interval constructed in Part a? i. There is a 95% chance that the population proportion lies within the constructed interval. ii. If 20 similar...
The human resources department needs to forecast the number of sexual harassement investigations for the entire company.
  The human resources department needs to forecast the number of sexual harassement investigations for the entire company. The data for several months is supplied below. Be careful since the data is listed beginning with the most recent. The forecasting method to be used here is the 4 month weighted moving average adjusting for seasonality where the weights, starting with the most recent time period, are 0.4, 0.3, 0.2, 0.1. Again, you must find the seasonality factors for the data....
Why human resources planning needs for the company? What is impact of human resources planning to...
Why human resources planning needs for the company? What is impact of human resources planning to business objectives?
How the Human Resources Department rewards the employees?
How the Human Resources Department rewards the employees?
The human resources department of a very large organisation is trying to determine the proportion of...
The human resources department of a very large organisation is trying to determine the proportion of all employees that are satisfied with their current position. They randomly select 121 employees and ask them: "Are you satisfied with your current position?" 61 replied yes they were. Construct a 95% confidence interval to estimate the true proportion of all employees at this workplace who were satisfied with their position. A 95% confidence interval for the true proportion of all employees at this...
How much Human Resources cost would be allocated to Cafeteria?
Marshall Welding Company has two service departments (Cafeteria and Human Resources) and two production departments (Machining and Assembly). The number of employees in each department follows. cafeteria 20 human resources 30 machining 100 assembly 150 Marshall Welding uses the step-down method of cost allocation and allocates cost on the basis of employees. Human Resources cost amounts to $1,200,000, and the department provides more service to the firm than Cafeteria. How much Human Resources cost would be allocated to Cafeteria? a....
How would a human resources department use information in the operating budgets?
How would a human resources department use information in the operating budgets?
Scheherazade is using the needs approach to determine how much life insurance to buy. Her needs...
Scheherazade is using the needs approach to determine how much life insurance to buy. Her needs are as follows: cash needs $130,000; income needs $780,000; special needs $100,000. Scheherazade has the following assets: cash $20,000, retirement plans $175,000, securities $35,000. She owns no individual life insurance but has an $85,000 group life policy through her employer. Based on this information, how much additional life insurance should Scheherazade purchase? Be sure to show your calculations.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT