Advertisement
Guest User

Untitled

a guest
Nov 28th, 2014
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.19 KB | None | 0 0
  1. static void Main(String[] args)
  2. {
  3. int Option;
  4. DisplayMenu();
  5. Option = GetUserOption();
  6. while (Option != 0)
  7. {
  8. switch (Option)
  9. {
  10. case 1:
  11. Num1();
  12. break;
  13. case 2:
  14. Num2();
  15. break;
  16. case 3:
  17. Overall();
  18. break;
  19. }
  20. }
  21. }
  22. static void DisplayMenu()
  23. {
  24. Console.WriteLine("1. Num1 2.Num2 3.Overall");
  25. }
  26. static int GetUserOption()
  27. {
  28. int Option;
  29. Console.WriteLine("Pick choice");
  30. Option = Convert.ToInt32(Console.ReadLine());
  31. return Option;
  32. }
  33. static int Num1()
  34. {
  35. int Num1;
  36. Console.WriteLine("Enter your first number");
  37. Num1 = Convert.ToInt32(Console.ReadLine());
  38. return Num1;
  39. }
  40.  
  41. static int Num2()
  42. {
  43. int Num2;
  44. Console.WriteLine("Enter your second number");
  45. Num2 = Convert.ToInt32(Console.ReadLine());
  46. return Num2;
  47. }
  48.  
  49. static int Overall(int Num1, int Num2)
  50. {
  51. int Overall;
  52. Console.WriteLine("This will add the two together");
  53. Overall = Overall + iNum1 + iNum2;
  54. Console.WriteLine(Overall);
  55. return Overall;
  56. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement