Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- namespace _2.GSM
- {
- class Battery
- {
- //<fields>
- private string model;
- private int hourIdle;
- private int hourTalk;
- //</fields>
- //<constructors>
- public Battery(string model)
- {
- this.model = model;
- this.hourIdle = 0;
- this.hourTalk = 0;
- }
- public Battery(string model, int hourIdle, int hourTalk)
- : this(model)
- {
- this.hourIdle = hourIdle;
- this.hourTalk = hourTalk;
- }
- //</constructors>
- }
- class Display
- {
- //<fields>
- private long colorNums;
- private double width;
- private double height;
- //</fields>
- //<constructors>
- public Display()
- {
- colorNums = 0;
- width = 0;
- height = 0;
- }
- public Display(long colorNum)
- : this()
- {
- this.colorNums = colorNum;
- }
- public Display(long colorNum, double width, double height)
- : this(colorNum)
- {
- this.height = height;
- this.width = width;
- }
- //</constructors>
- }
- class GSM
- {
- //<fields>
- Battery battery;
- Display display;
- private string model;
- private string manufacturer;
- private decimal price;
- private string owner;
- //</fields>
- //<constructors>
- public GSM(string model, string manufacturer)
- {
- this.model = model;
- this.manufacturer = manufacturer;
- price = 0.0m;
- owner = null;
- }
- public GSM(string model, string manufacturer, decimal price)
- : this(model, manufacturer)
- {
- this.price = price;
- }
- public GSM(string model, string manufacturer, decimal price, string owner)
- : this(model, manufacturer,price)
- {
- this.owner = owner;
- }
- //</constructors>
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement