Advertisement
radoslavzi

Second Problem

Feb 19th, 2013
469
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 2.13 KB | None | 0 0
  1. using System;
  2.  
  3.  
  4. namespace _2.GSM
  5. {
  6.     class Battery
  7.     {
  8.         //<fields>
  9.         private string model;
  10.         private int hourIdle;
  11.         private int hourTalk;
  12.         //</fields>
  13.         //<constructors>
  14.         public Battery(string model)
  15.         {
  16.             this.model = model;
  17.             this.hourIdle = 0;
  18.             this.hourTalk = 0;
  19.         }
  20.  
  21.         public Battery(string model, int hourIdle, int hourTalk)
  22.             : this(model)
  23.         {
  24.             this.hourIdle = hourIdle;
  25.             this.hourTalk = hourTalk;
  26.         }
  27.         //</constructors>
  28.  
  29.  
  30.     }
  31.     class Display
  32.     {
  33.         //<fields>
  34.         private long colorNums;
  35.         private double width;
  36.         private double height;
  37.         //</fields>
  38.  
  39.         //<constructors>
  40.         public Display()
  41.         {
  42.             colorNums = 0;
  43.             width = 0;
  44.             height = 0;
  45.         }
  46.         public Display(long colorNum)
  47.             : this()
  48.         {
  49.             this.colorNums = colorNum;
  50.  
  51.         }
  52.         public Display(long colorNum, double width, double height)
  53.             : this(colorNum)
  54.         {
  55.             this.height = height;
  56.             this.width = width;
  57.  
  58.         }
  59.         //</constructors>
  60.     }
  61.     class GSM
  62.     {
  63.         //<fields>
  64.         Battery battery;
  65.         Display display;
  66.         private string model;
  67.         private string manufacturer;
  68.         private decimal price;
  69.         private string owner;
  70.         //</fields>
  71.  
  72.         //<constructors>
  73.         public GSM(string model, string manufacturer)
  74.         {
  75.             this.model = model;
  76.             this.manufacturer = manufacturer;
  77.             price = 0.0m;
  78.             owner = null;
  79.  
  80.         }
  81.         public GSM(string model, string manufacturer, decimal price)
  82.             : this(model, manufacturer)
  83.         {
  84.             this.price = price;
  85.         }
  86.         public GSM(string model, string manufacturer, decimal price, string owner)
  87.             : this(model, manufacturer,price)
  88.         {
  89.            
  90.             this.owner = owner;
  91.         }
  92.         //</constructors>
  93.        
  94.     }
  95. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement