Two things:
Firstly, this line:
Console.WriteLine("Enter hourly rate: {0} " , rate);
doesn't input any values - it only Writes the current rate to the console for the user to read.
To get his response, you need to call
Console.ReadLine
and then convert his response to a number:
Console.Write("Enter hourly rate: ");
string input = Console.ReadLine();
double rate;
if (!double.TryParse(input, out rate))
{
Console.WriteLine($"\"{input}\" is not a valid number!\n Please try again.");
}
else
{
... your code to use the rate value goes here ...
}
Secondly, why does your code do this:
while (count<=3);
Since the line ends with a semicolon, that terminates the while loop - and you would get a warning about that along the lines of "empty statement".
But when your code enters the loop, it will never exit - because
count
never changes!
Pay attention to Warnings as well as errors - as a beginner, you should never run code with warnings - because the compiler does know better than you and is almost certainly pointing out things you really, really didn't mean to do! (I run with "treat warnings as errors" enabled, and I am far from a beginner!)