Advertisement
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;
- using System.Threading.Tasks;
- namespace HOA3_12EVA2AlbertoZ
- {
- class Program
- {
- static void Main(string[] args)
- {
- List<int> score = new List<int>();
- List<int> HPS = new List<int>();
- int choice = 0, qnum, nscore;
- while (choice != 5)
- {
- Console.WriteLine("------------------------------");
- Console.WriteLine("1 - Add Quiz");
- Console.WriteLine("2 - View Quiz");
- Console.WriteLine("3 - Corrections");
- Console.WriteLine("4 - View All Quizzess");
- Console.WriteLine("5 - Exit");
- Console.WriteLine("------------------------------");
- Console.Write("Enter choice: ");
- choice = int.Parse(Console.ReadLine());
- if (choice == 1)
- {
- Console.WriteLine("NEW QUIZ");
- Console.Write("Enter score: ");
- score.Add(int.Parse(Console.ReadLine()));
- Console.Write("Enter HPS: ");
- HPS.Add(int.Parse(Console.ReadLine()));
- Console.WriteLine("Quiz successfully added!");
- choice = 0;
- }
- else if (choice == 2)
- {
- Console.WriteLine("VIEW QUIZ");
- Console.Write("Enter quiz #: ");
- qnum = int.Parse(Console.ReadLine());
- Console.WriteLine("Score: " + score[qnum - 1] + "\tHPS: " + HPS[qnum - 1]);
- if (qnum > score.Count)
- {
- Console.WriteLine("Quiz " + qnum + " doesn't exist!");
- choice = 0;
- }
- else if (choice <= score.Count)
- {
- Console.WriteLine("Score: " + score[qnum - 1] + "\tHPS: " + HPS[qnum - 1]);
- choice = 0;
- }
- }
- else if (choice == 3)
- {
- Console.WriteLine("QUIZ CORRECTIONS");
- Console.Write("Enter quiz #: ");
- qnum = int.Parse(Console.ReadLine());
- Console.Write("Enter new score: ");
- nscore = int.Parse(Console.ReadLine());
- score[qnum - 1] = nscore;
- Console.WriteLine("Quiz " + qnum + " successfully updated!");
- choice = 0;
- }
- else if (choice == 4)
- {
- Console.WriteLine("CLASS STANDING");
- for (int i = 0; i < score.Count; i++)
- {
- Console.WriteLine("Item: " + items[i] + "\tPrice: " + prices[i] + "\tQuantity: x " + quantity[i]);
- }
- }
- Console.ReadKey();
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement