89 924
Assignments Done
99.4%
Successfully Done
In September 2020

# Answer to Question #48839 in Other Engineering for Dahbash

Question #48839
Write a program to read employee ID, employee hours worked. Assume pay per hour is \$750 , calculate the employee wages and display the out put as table?
1
2014-11-18T00:41:05-0500
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Globalization;
namespace Program
{
class Program
{
static void Main(string[] args)
{
const double CostPerHour = 750;
string ID = "";
double hours = 0;
Console.Write("Enter employee ID: ");
Console.Write("Enter hours worked: ");
while(!double.TryParse(Console.ReadLine(), out hours) || hours < 0)
{
Console.WriteLine("Must be positive digit!");
Console.Write("Enter hours worked: ");
}
Console.WriteLine("{0,-15}{1, 15}{2, 15}{3,15}", "Employee ID", "Hours worked", "Cost per hour", "Wage");
Console.WriteLine("{0,8}{1, 20}{2, 15}{3,20}", ID, hours.ToString("F2"), CostPerHour.ToString("C"), (hours * CostPerHour).ToString("C"));
Console.WriteLine("\nPress any key to continue...");
}
}
}
﻿

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!