Question: C# program. Using the exercise assigned previously, you will modify it to use methods to determine the salary without overtime and the salary with overtime.
C# program. Using the exercise assigned previously, you will modify it to use methods to determine the salary without overtime and the salary with overtime. Important: The program should allow the entry of several employees.
You must take into account the following conditions:
Input:
The program must allow the entry of the employee's name
The program must allow the entry of hours worked.
The program must allow the entry of the Hourly Rate.
Computes:
If the employee works 40 hours or less:
It will call the Method to determine salary without overtime.
If you work more than 40 hours.
It will call the Method to determine salary with overtime.
Methods:
salaryNoExtras
Gross Salary = Hours Worked * Hour Rate
salary with extras
Regular Salary = 40 * Hour Rate
Overtime = Hours WORKED - 40
Extra Salary = Overtime * (HourRate * 1.50)
Gross Salary = Regular Salary + Extra Salary
Output:
Name + Gross Salary


This previous work. We are supposed to modify this. The professor didn't explain anything else about this. The class and discussion about it will be later. I feel lost.
using System; class Program { public static void Main() { String employee_name; double hourly_rate, Gross_Salary,Overtime,Extra_Salary; int work_hour; // Getting input from user Console.Write("Enter employee's name : "); employee_name=Console.ReadLine(); Console.Write("Enter the total hours of work : "); work_hour Convert.ToInt32(Console.ReadLine()); Console.Write("Enter the hourly rate : "); hourly_rate = Double.Parse(Console.ReadLine()); // Calculating the gross salary of the employee if(work_hour>40){ Gross_Salary = 40 * hourly_rate; Overtime = work_hour - 40; Extra_Salary = Overtime* hourly_rate * 1.50; Gross_Salary=Gross_Salary+Extra_Salary; } else{ Gross_Salary = 40 * hourly_rate; } // Printing the output Console.Write(" >> ************************ "); Console.Write(" Employee Name : " + employee_name); Console.Write(" Gross Salary:" + Gross_Salary); } using System; class Program public static void Main() { String employee_name; double hourly_rate, Gross_Salary,Overtime,Extra_Salary; int work_hour; // Getting input from user Console.Write("Enter employee's name : "); employee_name=Console.ReadLine(); Console.Write("Enter the total hours of work: "); work_hour = Convert.Tolnt32(Console.ReadLine()); Console.Write("Enter the hourly rate : "); hourly_rate = Double.Parse(Console.ReadLine()); // Calculating the gross salary of the employee if(work_hour>40){ Gross_Salary = 40 * hourly_rate; Overtime = work_hour - 40; Extra_Salary = Overtime* hourly_rate * 1.50; Gross_Salary=Gross_Salary+Extra_Salary; } else{ Gross_Salary = 40 * hourly_rate; } // Printing the output Console.Write(" >> ************************ "); Console.Write(" Employee Name : " + employee_name); Console.Write(" Gross Salary:" + Gross_Salary); }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
