Ejemplo n.º 1
0
        public static void Main()
        {
            //       Nevermore60Customer foo = new Nevermore60Customer();  //compile error:  'Wrox.ProCSharp.OOProg.Nevermore60Customer' does not contain a constructor that takes 0 arguments

             Nevermore60Customer arabel = new Nevermore60Customer("Arabel Jones");
             Console.WriteLine( arabel.Name );
             Console.WriteLine( arabel.ReferrerName );

             GenericCustomer indiana = new Nevermore60Customer("Indiana Jones", "ihe");
             Console.WriteLine( indiana.Name );
             Console.WriteLine( indiana.ReferrerName ); //compile error:1: 'GenericCustomer' does not contain a definition for 'ReferrerName'
        }
Ejemplo n.º 2
0
        public static void Main()
        {
            Customer            cust1;
            Nevermore60Customer cust2;

            cust1 = new Customer();
            Console.WriteLine("Customer referencing Customer: "
                              + cust1.GetFunnyString());
            cust1 = new Nevermore60Customer();
            Console.WriteLine("Customer referencing Nevermore60Customer: "
                              + cust1.GetFunnyString());
            cust2 = new Nevermore60Customer();
            Console.WriteLine("Nevermore60Customer referencing: "
                              + cust2.GetFunnyString());
        }
Ejemplo n.º 3
0
 public static void Main()
 {
     GenericCustomer arabel = new Nevermore60Customer();
      arabel.Name = "Arabel Jones";
      GenericCustomer mrJones = new PayAsYouGoCustomer();
      mrJones.Name = "Ben Jones";
      GenericCustomer [] customers = new GenericCustomer[2];
      customers[0] = arabel;
      customers[0].RecordCall(TypeOfCall.CallToLandline, 20);
      customers[0].RecordCall(TypeOfCall.CallToCellPhone, 5);
      customers[1] = mrJones;
      customers[1].RecordCall(TypeOfCall.CallToLandline, 10);
      foreach (GenericCustomer nextCustomer in customers)
      {
     Console.WriteLine("{0,-20} owes ${1:F2}", nextCustomer.Name, nextCustomer.Balance);
      }
 }
Ejemplo n.º 4
0
        public static void Main()
        {
            GenericCustomer arabel = new Nevermore60Customer();

            arabel.Name = "Arabel Jones";
            GenericCustomer mrJones = new PayAsYouGoCustomer();

            mrJones.Name = "Ben Jones";
            GenericCustomer [] customers = new GenericCustomer[2];
            customers[0] = arabel;
            customers[0].RecordCall(TypeOfCall.CallToLandline, 20);
            customers[0].RecordCall(TypeOfCall.CallToCellPhone, 5);
            customers[1] = mrJones;
            customers[1].RecordCall(TypeOfCall.CallToLandline, 10);
            foreach (GenericCustomer nextCustomer in customers)
            {
                Console.WriteLine("{0,-20} owes ${1:F2}", nextCustomer.Name, nextCustomer.Balance);
            }
        }
Ejemplo n.º 5
0
 public static void Main()
 {
     GenericCustomer arabel = new Nevermore60Customer("Arabel Jones");
 }
Ejemplo n.º 6
0
 public static void Main()
 {
     Customer cust1;
      Nevermore60Customer cust2;
      cust1 = new Customer();
      Console.WriteLine("Customer referencing Customer: "
     + cust1.GetFunnyString());
      cust1 = new Nevermore60Customer();
      Console.WriteLine("Customer referencing Nevermore60Customer: "
     + cust1.GetFunnyString());
      cust2 = new Nevermore60Customer();
      Console.WriteLine("Nevermore60Customer referencing: "
     + cust2.GetFunnyString());
 }