Question: Your Assignment: This code is written in C#. Please correct this code so that it compiles and runs. This program contains 4 errors! Don't just

Your Assignment: This code is written in C#. Please correct this code so that it compiles and runs. This program contains 4 errors! Don't just correct the code but ALSO EXPLAIN WHAT YOU FIXED AND WHY!!

namespace DailyRate

{

class Program

{

static void Main(string[] args)

{

(new Program()).run();

}

void run()

{

double dailyRate = readDouble("Enter your daily rate: ");

int noOfDays = readInt("Enter the number of days: ");

writeFee(calculateFee(dailyRate, noOfDays));

}

private void writeFee(double p, int n)

{

Console.WriteLine("The consultant's fee is: {0}", p * 1.1);

}

private double calculateFee(double dailyRate, int noOfDays);

{

return dailyRate * noOfDays;

}

private double readInt(string p)

{

Console.Write(p);

string line = Console.ReadLine();

return int.Parse(line);

}

private double readDouble(int p)

{

Console.Write(p);

string line = Console.ReadLine();

return double.Parse(line);

}

}

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!