The program simply calculates the pay(hourlyrate*normal hours)
Output displayed
Enter hourly rate : 21,50
Enter normal hours worked : 2
Hourly rate : R21,50. Normal hours :2
PAY : R43,00
using System;
class ConsoleApp
{
static void Main()
{
while (true)
{
try
{
Console.Write("Enter hourly rate: ");
double rate = Double.Parse(Console.ReadLine());
Console.Write("Enter normal hours worked: ");
int hour = Int32.Parse(Console.ReadLine());
Console.WriteLine($"PAY: R{rate * hour:0.00}");
return;
}
catch (System.FormatException e)
{
Console.WriteLine("Incorrect input");
}
}
}
}
Comments
Leave a comment