Advertisement
callumbinner22

Sports Team #1

Dec 14th, 2016
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.18 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 void Main(string[] args)
  12.         {
  13.             List<string> CreweFC = new List<string>();
  14.             Console.WriteLine("Welcome to the Crewe FC data base. Please add a player");
  15.             CreweFC.Add(Console.ReadLine());
  16.             for ( int x =0; x<10; x++ )
  17.             {
  18.                 Console.WriteLine("Please add your next player");
  19.                 CreweFC.Add(Console.ReadLine());
  20.             }
  21.             Console.Clear();
  22.             Console.WriteLine("Would you like to view your team?");
  23.                 string option = Console.ReadLine();
  24.             if (option == "yes")
  25.             {
  26.                 foreach(string item in CreweFC)
  27.                 {
  28.                     Console.WriteLine(item);
  29.                 }
  30.                 Console.WriteLine("Total players on team = " + CreweFC.Count);
  31.             }
  32.             else
  33.             {
  34.                 Console.WriteLine("Press enter to exit");
  35.                 Console.ReadLine();
  36.             }
  37.         }
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement