Hi,
I have written this new code but it is not working and i am not able to debug the program as there is some syntax error. As I am new to C# programming I am not sure where I am going wrong
Code:
{
class Program
{
static void Main(string[] args)
{
String response;
Double labor = 0, cost = 0, lc, pc, tc, total = 0;
int count = 0;
do
{
Console.WriteLine("Please Enter the Customer Name or quit to end: ");
response = Console.ReadLine();
if (response != "quit")
{
Console.WriteLine("Please Enter hours of labor: ");
labor = Console.Read();
Console.WriteLine("Please Enter cost of parts: ");
cost = Console.Read();
lc = labor * 35;
pc = cost + 0.5;
tc = lc + pc;
total = total + tc;
Console.WriteLine("Customer : " + response);
Console.WriteLine("Labor Cost: " + lc);
Console.WriteLine("Parts Cost: " + pc);
Console.WriteLine();
count = count + 1;
}
Console.Write("The total cost is {0:c} ", total);
Console.Write(" for " + count + " customers.");
Console.Write();
} while (response != "quit");
}
}
}
the output that I am giving is
if I enter a cust name it will run the 'if' loop and if I type quit then it will just show the total and end the loop....
And I am not able to get any output of any sort there is no error in the code but it is not working