Advertisement
callumbinner22

Sports Team #2

Dec 14th, 2016
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.52 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 ConsoleApplication52
  8. {
  9.     class Program
  10.     {
  11.         static List<string> CreweFC = new List<string>();
  12.         static void Main(string[] args)
  13.         {
  14.  
  15.             bool conti = true;
  16.  
  17.             while (conti)
  18.             {
  19.  
  20.  
  21.                
  22.                 Console.WriteLine("Welcome to the Crewe FC data base.");
  23.                 Console.WriteLine(" 1) Add New Player");
  24.                 Console.WriteLine(" 2) View Team");
  25.                 Console.WriteLine(" 3) Sort Team Alphabetcially");
  26.                 Console.WriteLine(" 4) Sort Team Reverse Alphabetically");
  27.                 int input = Convert.ToInt32(Console.ReadLine());
  28.  
  29.  
  30.  
  31.                 if (input == 1)
  32.                 {
  33.  
  34.                     for (int x = 0; x < 11; x++)
  35.                     {
  36.                         Console.WriteLine("Please add your next player");
  37.                         CreweFC.Add(Console.ReadLine());
  38.                     }
  39.                 }
  40.  
  41.                 if (input == 2)
  42.                 {
  43.                     Console.Clear();
  44.                     Console.WriteLine("Viewing your team?");
  45.                     foreach (string item in CreweFC)
  46.                     {
  47.                         Console.WriteLine(item);
  48.                     }
  49.                     Console.WriteLine("Total players on team = " + CreweFC.Count);
  50.                 }
  51.  
  52.                 if (input == 3)
  53.                 {
  54.                     CreweFC.Sort();
  55.                     Console.WriteLine(CreweFC);
  56.                     foreach (string item in CreweFC)
  57.                     {
  58.                         Console.WriteLine(item);
  59.                     }
  60.                        
  61.                 }
  62.  
  63.                 if (input == 4)
  64.                 {
  65.                     CreweFC.Sort();
  66.                     CreweFC.Reverse();
  67.                     foreach (string item in CreweFC)
  68.                     {
  69.                         Console.WriteLine(item);
  70.                     }
  71.                  }
  72.  
  73.                
  74.  
  75.                 Console.WriteLine("Return to menu?");
  76.                 string decision = Console.ReadLine();
  77.                 if (decision == "yes")
  78.                 {
  79.                     conti = true;
  80.                     Console.Clear();
  81.                 }
  82.                 else if (decision =="no")
  83.                 {
  84.                     conti = false;
  85.                 }
  86.             }
  87.  
  88.         }
  89.     }
  90. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement