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 OBJECTORIENTATEDCODE
- {
- class Program
- {
- static void Main(string[] args)
- {
- country Botswana = new country()
- {
- name = "Botswana",
- population = 20,
- GDP = 90.00,
- };
- Botswana.Disease();
- Botswana.war();
- }
- }
- class country
- {
- public string name;
- public int population;
- public double GDP;
- public void Disease()
- {
- // Console.WriteLine("Number of sides " + this.numberofsides);
- // Console.WriteLine("Side length " + this.sidelength);
- // Console.WriteLine("Regular? " + this.regular);
- Console.WriteLine("Remaining population after disease. ");
- Console.WriteLine(this.population * 0.15);
- }
- public void war()
- {
- Console.WriteLine("Remaining population after war ");
- Console.WriteLine(this.population * 0.15 * 0.1);
- Console.WriteLine("Updated GDP ");
- Console.WriteLine(GDP / 0.1);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement