Assignment task:
C#. Using Visual Studio, write a console application that gets three number from the user and computes their average.
You will be evaluated on the following criteria:
- Program prompts the user to enter 3 numbers.
- Program gets input from the user.
- Program converts user input from string to a number type.
- Program computes the average of the three numbers.
- Program displays message informing user of the average of the three numbers.
Here's my code... I don't know why i'm getting an error. please provide proof with screenshots that you fix it and screenshots after you ran the with the fixed code.
using System;
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter three numbers:");
string input1 = Console.ReadLine();
string input2 = Console.ReadLine();
string input3 = Console.ReadLine();
double num1 = double.Parse(input1);
double num2 = double.Parse(input2);
double num3 = double.Parse(input3);
double average = (num1 + num2 + num3) / 3;
Console.WriteLine("The average of the three numbers is: " + average);
}
}