Wednesday, September 24, 2014

First Exercise Assignment1

Here is the first exercise of assignment 1

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Assignment1
{
    class Program
    {
        /**********************
         * this is for assignment1
         * Part 1 entering name and email
         * Steve Conger 9/24/2014
         ***********************/
        static void Main(string[] args)
        {
            //declare variables
            string firstName;
            string lastName;
            string email;

            //get input
            Console.WriteLine("Enter your first name");
            firstName = Console.ReadLine();
            Console.WriteLine("Enter your last name");
            lastName = Console.ReadLine();
            Console.WriteLine("Enter your email");
            email = Console.ReadLine();

            //display output
            Console.WriteLine("{0}, {1}--{2}", lastName, firstName, email);
            Console.WriteLine(lastName + ", " + firstName + "--" + email);

            Console.ReadKey();
        }
    }
}

No comments:

Post a Comment