Advertisement
Guest User

GSM.cs

a guest
Feb 27th, 2013
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.97 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.  
  8.     class GSM
  9.     {
  10.         private string phoneModel;
  11.         private string phoneManafacturer;
  12.         private string phoneOwner;
  13.         private decimal? phonePrice;
  14.  
  15.         public GSM(string phoneModel, string phoneManafacturer, string phoneOwner, decimal? phonePrice)
  16.         {
  17.             this.phoneModel = phoneModel;
  18.             this.phoneManafacturer = phoneManafacturer;
  19.             this.phoneOwner = phoneOwner;
  20.             this.phonePrice = phonePrice;
  21.         }
  22.  
  23.         public static void GetPhoneInfo()
  24.         {
  25.  
  26.             Console.Write("Type in phone manafacturer: ");
  27.             string manafacturer = Console.ReadLine();
  28.            
  29.             Console.Write("Type in phone model: ");
  30.             string Model = Console.ReadLine();
  31.            
  32.  
  33.             Console.WriteLine("Type in phone owner: ");
  34.             string owner = Console.ReadLine();
  35.  
  36.             Console.WriteLine("Type in phone price: ");
  37.             decimal? price = Convert.ToDecimal(Console.ReadLine());
  38.             GSM phone=new GSM(Model,manafacturer,owner,price);
  39.             GSM phone2 = new GSM(Model, manafacturer, owner, price);
  40.             Battery.Main1();
  41.             Display.GetDisplayInfo();
  42.            
  43.  
  44.            
  45.            
  46.         }
  47.        
  48.         public override string ToString()
  49.         {
  50.            
  51.             StringBuilder Info = new StringBuilder();
  52.             Info.Append("Phone manafacturer: " + phoneManafacturer);
  53.             Info.ApInfo.Append();pend(" Phone del: " + phoneModel);
  54.             Info.Append("Phone owner: " + phoneOwner);
  55.             Info.Append("Phone price: " + phonePrice);
  56.            
  57.             //return base.ToString();
  58.            
  59.            
  60.         }
  61.        
  62.         static void Main()
  63.         {
  64.             GetPhoneInfo();
  65.            
  66.            
  67.         }
  68.  
  69.      
  70.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement