Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- namespace CIS247A_Wk1_Lab_Hager
- {
- class Program
- {
- static void Main(string[] args)
- {
- /*
- *********************************
- * Programming Week Lab 1 *
- * User Interface *
- * Developer Dave Hager *
- * Date Completed 9/4/2012 *
- *********************************
- */
- //Methods
- DisplayApplicationInformation();
- DisplayDivider("start Program");
- GetInput();
- GetAge();
- GetMileage();
- Console.Write("\nThank you for using basic interface program");
- HoldWindowOpen();
- }
- private static void DisplayApplicationInformation()
- {
- Console.WriteLine("Welcome to the Basic User Interface");
- Console.WriteLine("CIS247A, Week 1 Lab");
- Console.WriteLine("Solution");
- Console.WriteLine("This program accepts user input as a string,\nthen makes the appropriate data conversion.");
- }
- private static void DisplayDivider(string outputTitle)
- {
- Console.WriteLine("******** "+ outputTitle +" ********");
- }
- public static string GetInput()
- {
- string input;
- DisplayDivider("name");
- Console.Write("Your name is: " );
- input = Convert.ToString(Console.ReadLine());
- return input;
- }
- private static string GetAge()
- {
- string age;
- DisplayDivider("age");
- Console.Write("Your Age is: ");
- age = Convert.ToString(Console.ReadLine());
- return age;
- }
- private static string GetMileage()
- {
- string mileage = "";
- DisplayDivider("mileage");
- Console.Write("Your Mileage is: 22.5");
- return mileage;
- }
- private static void HoldWindowOpen()
- {
- Console.WriteLine();
- Console.WriteLine("Hit Enter to Close Window");
- Console.ReadLine();
- }
- }
- }
Add Comment
Please, Sign In to add comment