Advertisement
khaiwen1111

Practical 6 Part B Q1

Jul 19th, 2018
118
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.53 KB | None | 0 0
  1. public class countryList
  2. {
  3.     public static void Main()
  4.     {
  5.         ArrayList countries = new ArrayList();
  6.         country c1 = new Country("korea", "asia");
  7.         country c2 = new Country ("UNITED KINGDOM","Europe");
  8.         country c3 = new Country ("Canada","North America");
  9.         country c4 = new Country ("South Africa","Africa");
  10.  
  11.         countries.Add(c1);
  12.         countries.Add(c2);
  13.         countries.Add(c3);
  14.         countries.Add(c4);
  15.  
  16.         foreach (Country country in countries)
  17.         {
  18.             Console.WriteLine("Name:{0}m \n\tContinent:{1}",country.Name,country.Continent);
  19.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement