The following Programming Challenges can be solved by a prog
The following Programming Challenges can be solved by a program that performs three basic tasks-Input Data, Process Data, and Output Results. For each problem, use pseudocode to design a suitable program to solve it. be sure to identify the data type of each variable used.
The owners of the Super Supermarket would like to have a program that computes the monthly gross pay of their employees as well as the employees\'s net pay. The input for this program is an employee ID number, hourly rate of pay, and number of regular hours and overtime hours worked. Gross pay is the sum of the wages earned from regular hours and overtime hours; overtime is paid at 1.5 times the regular rate. Net pay is gross pay minus deductions. Assume that deductions are taken for tax withholding (30 percent of gross pay) and parking ($10 per month). You will need the following variables:
EmployeeID HourlyRate RegHours OvertimeHours GrossPay Tax Parking NetPay
you will need the following formulas:
GrossPay = (RegularHours * HourlyRate) + (OvertimeHours * (HourlyRate * 1.5))
NetPay = GrossPay - (GrossPay * Tax) - Parking
how do you solve this in plain pseudocode without the programming language?
Solution
Hi, Please find my psudocode:
calculateGrossPay(){
// declaring variable
string eEmployeeID
double HourlyRate
int RegHours
int OvertimeHours
double GrossPay
double Tax = 0.3
double Parking = 10
double NetPay
// take input
eEmployeeID <- input
HourlyRate <- input
RegHours <- input
OvertimeHours <- input
// calculating gross pay
GrossPay = (RegularHours * HourlyRate) + (OvertimeHours * (HourlyRate * 1.5))
// calculating net pay
NetPay = GrossPay - (GrossPay * Tax) - Parking
// Output
print eEmployeeID
print GrossPay
print NetPay
}
