Advertisement
callumbinner22

Country Class

Apr 24th, 2017
62
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.35 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 OBJECTORIENTATEDCODE
  8. {
  9.     class Program
  10.     {
  11.         static void Main(string[] args)
  12.         {
  13.             country Botswana = new country()
  14.             {
  15.                 name = "Botswana",
  16.                 population = 20,
  17.                 GDP = 90.00,
  18.              
  19.  
  20.             };
  21.            
  22.            Botswana.Disease();
  23.            Botswana.war();
  24.            
  25.         }
  26.     }
  27.  
  28.  
  29.  
  30.  
  31.     class country
  32.     {
  33.  
  34.  
  35.  
  36.  
  37.  
  38.  
  39.         public string name;
  40.         public int population;
  41.         public double GDP;
  42.        
  43.  
  44.         public void Disease()
  45.         {
  46.             // Console.WriteLine("Number of sides " + this.numberofsides);
  47.             //  Console.WriteLine("Side length " + this.sidelength);
  48.             //  Console.WriteLine("Regular? " + this.regular);
  49.            
  50.             Console.WriteLine("Remaining population after disease. ");
  51.             Console.WriteLine(this.population * 0.15);
  52.            
  53.  
  54.         }
  55.         public void war()
  56.         {
  57.             Console.WriteLine("Remaining population after war ");
  58.             Console.WriteLine(this.population * 0.15 * 0.1);
  59.             Console.WriteLine("Updated GDP ");
  60.             Console.WriteLine(GDP / 0.1);
  61.         }
  62.  
  63.  
  64.  
  65.     }
  66. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement