Advertisement
Kenkaster001

Z ALBERTO CODE

Jul 16th, 2019
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.14 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6.  
  7. namespace HOA3_12EVA2AlbertoZ
  8. {
  9. class Program
  10. {
  11. static void Main(string[] args)
  12. {
  13. List<int> score = new List<int>();
  14. List<int> HPS = new List<int>();
  15.  
  16. int choice = 0, qnum, nscore;
  17.  
  18.  
  19.  
  20. while (choice != 5)
  21. {
  22. Console.WriteLine("------------------------------");
  23. Console.WriteLine("1 - Add Quiz");
  24. Console.WriteLine("2 - View Quiz");
  25. Console.WriteLine("3 - Corrections");
  26. Console.WriteLine("4 - View All Quizzess");
  27. Console.WriteLine("5 - Exit");
  28. Console.WriteLine("------------------------------");
  29. Console.Write("Enter choice: ");
  30. choice = int.Parse(Console.ReadLine());
  31.  
  32. if (choice == 1)
  33. {
  34.  
  35. Console.WriteLine("NEW QUIZ");
  36. Console.Write("Enter score: ");
  37. score.Add(int.Parse(Console.ReadLine()));
  38. Console.Write("Enter HPS: ");
  39. HPS.Add(int.Parse(Console.ReadLine()));
  40. Console.WriteLine("Quiz successfully added!");
  41. choice = 0;
  42. }
  43. else if (choice == 2)
  44. {
  45. Console.WriteLine("VIEW QUIZ");
  46. Console.Write("Enter quiz #: ");
  47. qnum = int.Parse(Console.ReadLine());
  48. Console.WriteLine("Score: " + score[qnum - 1] + "\tHPS: " + HPS[qnum - 1]);
  49.  
  50. if (qnum > score.Count)
  51. {
  52. Console.WriteLine("Quiz " + qnum + " doesn't exist!");
  53. choice = 0;
  54. }
  55. else if (choice <= score.Count)
  56. {
  57. Console.WriteLine("Score: " + score[qnum - 1] + "\tHPS: " + HPS[qnum - 1]);
  58. choice = 0;
  59. }
  60.  
  61. }
  62. else if (choice == 3)
  63. {
  64. Console.WriteLine("QUIZ CORRECTIONS");
  65. Console.Write("Enter quiz #: ");
  66. qnum = int.Parse(Console.ReadLine());
  67. Console.Write("Enter new score: ");
  68. nscore = int.Parse(Console.ReadLine());
  69. score[qnum - 1] = nscore;
  70. Console.WriteLine("Quiz " + qnum + " successfully updated!");
  71. choice = 0;
  72. }
  73. else if (choice == 4)
  74. {
  75. Console.WriteLine("CLASS STANDING");
  76. for (int i = 0; i < score.Count; i++)
  77. {
  78. Console.WriteLine("Item: " + items[i] + "\tPrice: " + prices[i] + "\tQuantity: x " + quantity[i]);
  79. }
  80. }
  81.  
  82.  
  83. Console.ReadKey();
  84.  
  85.  
  86.  
  87.  
  88.  
  89. }
  90.  
  91.  
  92. }
  93. }
  94. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement