Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace payroll
- {
- class Program
- {
- static void Main(string[] args)
- {
- string[] names = { "tanya", "dana", "sara", "scott", "paul", "dale", "bret", "karen", "tracy" };
- int[] hours = { 40, 45, 38, 42, 48, 40, 35, 48, 36 };
- double[] rates = { 7.5, 14.9, 12, 9.75, 8.72, 10.25, 8, 9, 11 };
- Console.WriteLine("Employee Hours\tRegular\tOT\tGross\nName\tWorked\tPay\tPay\tPay\tFIT\tNet Pay");
- for (int x = 0; x < names.Length; x++)
- {
- double regularPay=0;
- double overtimePay = 0;
- double grossPay = 0;
- double fit = 0;
- double netPay = 0;
- if (hours[x] > 40)
- {
- regularPay = 40 * rates[x];
- overtimePay = (hours[x] - 40) * 1.5 * rates[x];
- }
- else
- {
- regularPay = hours[x] * rates[x];
- overtimePay = 0;
- }
- grossPay = regularPay + overtimePay;
- fit = grossPay * fit;
- netPay = grossPay - fit;
- Console.WriteLine(names[x] + "\t" + hours[x] + "\t$" + regularPay + "\t$" + overtimePay + "\t$" + grossPay + "\t$" + fit + "\t$" + netPay);
- }
- Console.ReadLine();
- // new worker =
- }
- }
- class worker
- {
- public string name;
- public int hours;
- public double rate;
- }
- }
Add Comment
Please, Sign In to add comment