//Program Name: Basic User Interface
//Programmer: Shania Joe
//CIS-247A: Week One (1) - iLab
//Program Description: This program accepts user input as a string, and then makes the appropriate data conversion.
using System; using System.IO; using System.Collections.Generic; using System.Linq; using System.Text;
namespace CIS247_WEEK1_iLAB_JOE
{
class Program { /// <summary> /// Name: User input's name - converted to string. /// Age: User input's age - converted to interger. /// Gas Mileage: User input's car gas mileage - converted to double. /// </summary> private string name; private int age; private double gasMileage;
/// <summary> /// Main Function to Control Function Calling and Flow. /// </summary> /// <param name="args"></param> static void Main(string[] args) { //Create a program object and new instance. Program objProgram = new Program();
//Display basic information using DisplayApplicationInformation function. objProgram.DisplayApplicationInformation();
objProgram.DisplayDivider("Start Program"); Console.WriteLine(); objProgram.DisplayDivider("Get Name"); objProgram.name = objProgram.GetInput("Your Name"); Console.WriteLine("Your Name is: {0}", objProgram.name); Console.WriteLine();
objProgram.DisplayDivider("Get Age"); objProgram.age =Convert.ToInt32 ( objProgram.GetInput("Your Age") ) ; Console.WriteLine("Your Age is: {0}", objProgram.age); Console.WriteLine();
objProgram.DisplayDivider("Get Mileage"); objProgram.gasMileage = Convert.ToDouble(objProgram.GetInput("Gas Mileaage"));