Guest User

Untitled

a guest
Nov 17th, 2018
105
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.56 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5.  
  6. namespace CIS247A_Wk1_Lab_Hager
  7. {
  8. class Program
  9. {
  10. static void Main(string[] args)
  11. {
  12. /*
  13. *********************************
  14. * Programming Week Lab 1 *
  15. * User Interface *
  16. * Developer Dave Hager *
  17. * Date Completed 9/4/2012 *
  18. *********************************
  19. */
  20.  
  21. //Methods
  22. DisplayApplicationInformation();
  23. DisplayDivider("start Program");
  24. GetInput();
  25. GetAge();
  26. GetMileage();
  27. Console.Write("\nThank you for using basic interface program");
  28. HoldWindowOpen();
  29.  
  30.  
  31. }
  32.  
  33. private static void DisplayApplicationInformation()
  34. {
  35. Console.WriteLine("Welcome to the Basic User Interface");
  36. Console.WriteLine("CIS247A, Week 1 Lab");
  37. Console.WriteLine("Solution");
  38. Console.WriteLine("This program accepts user input as a string,\nthen makes the appropriate data conversion.");
  39.  
  40. }
  41.  
  42. private static void DisplayDivider(string outputTitle)
  43. {
  44.  
  45.  
  46. Console.WriteLine("******** "+ outputTitle +" ********");
  47.  
  48.  
  49.  
  50.  
  51. }
  52. public static string GetInput()
  53.  
  54. {
  55.  
  56.  
  57. string input;
  58. DisplayDivider("name");
  59. Console.Write("Your name is: " );
  60. input = Convert.ToString(Console.ReadLine());
  61. return input;
  62.  
  63.  
  64. }
  65.  
  66. private static string GetAge()
  67.  
  68. {
  69.  
  70. string age;
  71. DisplayDivider("age");
  72. Console.Write("Your Age is: ");
  73. age = Convert.ToString(Console.ReadLine());
  74. return age;
  75.  
  76. }
  77. private static string GetMileage()
  78.  
  79. {
  80. string mileage = "";
  81. DisplayDivider("mileage");
  82. Console.Write("Your Mileage is: 22.5");
  83. return mileage;
  84. }
  85.  
  86. private static void HoldWindowOpen()
  87. {
  88. Console.WriteLine();
  89. Console.WriteLine("Hit Enter to Close Window");
  90. Console.ReadLine();
  91. }
  92. }
  93. }
Add Comment
Please, Sign In to add comment