Laborator 03

Problem 1:

Implement a Queue (push(), pop(), back(), front(), isEmpty(), toString()).

Problem 2:

Implement a class with a fromXml() constructor + toXml().

  class Example{
  
      int varA;
  
      int varB;
  
      String varC;
  
      List <int> varD;
  
      double varE;
  
  }

Problem 3:

a) Create a class Client that have 2 private attributes:

  • Name - can't be changed

  • PurchasesAmount(double) - that have 2 methods: get(), add()

b) Create a constructor that initialize the name

c) Create a class LoyalClient that have 1 private attribute:

  • PurchasesAmount(double) - that have 1 method: get() (use different name from the method in superclass)

d) Create a method discount() that assign to PurchasesAmount (subclass) the value of PurchasesAmount (superclass) after reduction of 10%.

e) Create a small test program (main).