76 362
Assignments Done
Successfully Done
In May 2019

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?
Expert's answer
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Globalization;
namespace Program
class Program
static void Main(string[] args)
const double CostPerHour = 750;
string ID = "";
double hours = 0;
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture("en-US");
Console.Write("Enter employee ID: ");
ID = Console.ReadLine();
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!


No comments. Be first!

Leave a comment

Ask Your question

Privacy policy Terms and Conditions