Write a console application that gets number from user


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);

   }

}

Request for Solution File

Ask an Expert for Answer!!
Programming Languages: Write a console application that gets number from user
Reference No:- TGS03306469

Expected delivery within 24 Hours