Receiving Input

We need to store user's input into a variable.

We could declare the variables like code below.

namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {
            string entry;

            // Prompt the for minutes exercised
            System.Console.Write("Enter how many minutes you exercised");
            entry = System.Console.ReadLine(); 

            // Add minutes exercised to a running total
            // Display the running total in minutes
            // Ask repeatedly until user quits
        }
    }
}

or like this.

namespace ConsoleApp1
{
    class Program
    {
        static void Main()
        {        
            // Prompt the for minutes exercised
            System.Console.Write("Enter how many minutes you exercised");
            String entry = System.Console.ReadLine(); 

            // Add minutes exercised to a running total
            // Display the running total in minutes
            // Ask repeatedly until user quits
        }
    }
}

results matching ""

    No results matching ""