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 ConsoleApplication52
- {
- class Program
- {
- static List<string> CreweFC = new List<string>();
- static void Main(string[] args)
- {
- bool conti = true;
- while (conti)
- {
- Console.WriteLine("Welcome to the Crewe FC data base.");
- Console.WriteLine(" 1) Add New Player");
- Console.WriteLine(" 2) View Team");
- Console.WriteLine(" 3) Sort Team Alphabetcially");
- Console.WriteLine(" 4) Sort Team Reverse Alphabetically");
- int input = Convert.ToInt32(Console.ReadLine());
- if (input == 1)
- {
- for (int x = 0; x < 11; x++)
- {
- Console.WriteLine("Please add your next player");
- CreweFC.Add(Console.ReadLine());
- }
- }
- if (input == 2)
- {
- Console.Clear();
- Console.WriteLine("Viewing your team?");
- foreach (string item in CreweFC)
- {
- Console.WriteLine(item);
- }
- Console.WriteLine("Total players on team = " + CreweFC.Count);
- }
- if (input == 3)
- {
- CreweFC.Sort();
- Console.WriteLine(CreweFC);
- foreach (string item in CreweFC)
- {
- Console.WriteLine(item);
- }
- }
- if (input == 4)
- {
- CreweFC.Sort();
- CreweFC.Reverse();
- foreach (string item in CreweFC)
- {
- Console.WriteLine(item);
- }
- }
- Console.WriteLine("Return to menu?");
- string decision = Console.ReadLine();
- if (decision == "yes")
- {
- conti = true;
- Console.Clear();
- }
- else if (decision =="no")
- {
- conti = false;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement