using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

 

namespace Assignment1BShedd

{

    class Calculator

    {

        public static void Main( string[] args )

        {

            int numb1; //stores the user's input as a whole number

            int numb2; //stores the user's second whole number

            int numb3; //stores the user's third and final whole number

            int sum;   //declares the mathematic evalutaion of the two numbers added up

            int avg;   //calculates the average of all three whole numbers

            int result;//multiplies all three whole numbers together

            int x;

 

            Console.WriteLine("{0}\n{1}", "Hello I am the Calculator!", "Please enter your first whole number:");// this asks for a user input

            numb1 = Convert.ToInt32( Console.ReadLine() );//reads first whole number

 

            Console.WriteLine("Now enter the next whole number:");

            numb2 = Convert.ToInt32( Console.ReadLine() );//reads second whole number

 

            Console.WriteLine("Finally enter the last whole number:");

            numb3 = Convert.ToInt32( Console.ReadLine() );//reads last whole number

 

            x=3;

            sum = numb1 + numb2 + numb3; //adds all three whole numbers

            avg = sum/x; //averages all three whole numbers

            result = numb1 * numb2 * numb3;//calculates the product of all three

 

            Console.WriteLine("Calculating...");

            Console.WriteLine(" The sum is: {0}", sum);

            Console.WriteLine(" The average is: {0}", avg);

            Console.WriteLine(" The product is: {0}", result);

            Console.WriteLine(" Programmed by: Bradley Shedd IT3883");

               Console.ReadLine();

        }

    }

}

 

 

Homepage