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;
- namespace AssesTblFootball
- {
- class Program
- {
- static void Main(string[] args)
- {
- // Define the variables
- int N;
- int point;
- int play;
- string team;
- // Determine array size
- Console.WriteLine("How many teams?");
- N = Convert.ToInt32(Console.ReadLine());
- // Define the arrays & size
- string[] teams = new string[N];
- int[,] PlayedPoints = new int[N, N];
- // Add teams, scores & matches to arrays
- for (int i = 0; i < N; i++)
- {
- Console.WriteLine("Enter team name:");
- team = Console.ReadLine();
- teams[i] = team;
- Console.WriteLine("Enter points scored");
- point = Convert.ToInt32(Console.ReadLine());
- PlayedPoints[i, 0] = point;
- Console.WriteLine("Enter games played");
- play = Convert.ToInt32(Console.ReadLine());
- PlayedPoints[i, 1] = play;
- }
- Console.WriteLine("View results?");
- char yn = Convert.ToChar(Console.ReadLine());
- if (yn == 'Y' || yn == 'y')
- {
- //Print team info from arrays
- for (int i = 0; i < teams.Length; i++)
- {
- Console.WriteLine("------------");
- Console.WriteLine("Team: {0} \nPoints: {1} \nPlayed: {2}", teams[i], PlayedPoints[i, 0], PlayedPoints[i, 1]);
- Console.ReadKey();
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement