Advertisement
Guest User

Untitled

a guest
Mar 20th, 2019
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.35 KB | None | 0 0
  1. {
  2. Console.BackgroundColor = ConsoleColor.DarkRed;
  3. Console.Clear();
  4. Console.ForegroundColor = ConsoleColor.White;
  5.  
  6. bool isRunning = true;
  7. while (isRunning)
  8. {
  9. Console.WriteLine("\t\t Välj ett alternativ!");
  10. Console.WriteLine("\n\t[ 1 ]\tLägg till ett förmål i ryggsäcken");
  11. Console.WriteLine("\t[ 2 ]\tVisa allaföremål som finns i ryggsäcken"); // video konkatonera
  12. Console.WriteLine("\t[ 3 ]\tSÖk i ryggsäcken");
  13. Console.WriteLine("\t[ 4 ]\tRensa innehåll");
  14. Console.WriteLine("\t[ 4 ]\tAvsluta");
  15. string[] rygga = new string[5];
  16. //Int32.TryParse(Console.ReadLine(), out int xxxxxx);
  17.  
  18. int contentbpack = Convert.ToInt32(Console.ReadLine());
  19.  
  20. switch (contentbpack)
  21. {
  22. case 1:
  23. Console.Write("Lägg till ett förmål 1: ");
  24. rygga[0] = Console.ReadLine();//Convert.ToInt32(Console.ReadLine());
  25. Console.Write("Lägg till ett föremål 2: ");
  26. rygga[1] = Console.ReadLine(); //Convert.ToInt32(Console.ReadLine());
  27. Console.Write("Lägg till ett föremål 3: ");
  28. rygga[2] = Console.ReadLine(); //Convert.ToInt32(Console.ReadLine());
  29. Console.Write("Lägg till ett föremål 4: ");
  30. rygga[3] = Console.ReadLine(); //Convert.ToInt32(Console.ReadLine());
  31. Console.Write("Lägg till ett föremål 5: ");
  32. rygga[4] = Console.ReadLine();//Convert.ToInt32(Console.ReadLine());
  33. break;
  34. case 2:
  35. Console.WriteLine("\tRyggsäcken innhåller!" ); // video konkatonera
  36. break;
  37. case 3:
  38. break;
  39. case 4:
  40. isRunning = false;
  41. break;
  42.  
  43.  
  44. default:
  45. Console.WriteLine("Felakting knapptryck var god försök igen!");
  46. break;
  47.  
  48.  
  49.  
  50. }
  51.  
  52.  
  53. }
  54.  
  55. }
  56. }
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement