Differences

This shows you the differences between two versions of the page.

Link to this comparison view

poo:laboratoare:13 [2021/01/17 19:25]
carmen.odubasteanu
poo:laboratoare:13 [2023/12/09 11:42] (current)
carmen.odubasteanu
Line 1: Line 1:
-===== Laboratorul ​13. =====+===== Laboratorul ​11. =====
  
 === Problema 1 - Singleton ​ === === Problema 1 - Singleton ​ ===
Line 19: Line 19:
 <code java> <code java>
 public abstract class User { public abstract class User {
-  ​private ​String firstName, lastName;+  ​protected ​String firstName, lastName;
   public User(String firstName, String lastName) {   public User(String firstName, String lastName) {
     this.firstName = firstName;     this.firstName = firstName;
Line 42: Line 42:
         User studentC = UserFactory.createUser("​Student",​ "​C",​ "​Ionescu"​);​         User studentC = UserFactory.createUser("​Student",​ "​C",​ "​Ionescu"​);​
  
-        User mother = UserFactory.createUser("​Parent",​ "MAC", "​Ionescu"​);​ +        User mother = UserFactory.createUser("​Parent",​ "M_AC", "​Ionescu"​);​ 
-        User father = UserFactory.createUser("​Parent",​ "MAC", "​Ionescu"​);​+        User father = UserFactory.createUser("​Parent",​ "T_AC", "​Ionescu"​);​
                
         User teacher = UserFactory.createUser("​Teacher",​ "​Teacher",​ "​Georgescu"​);​         User teacher = UserFactory.createUser("​Teacher",​ "​Teacher",​ "​Georgescu"​);​
Line 156: Line 156:
 <​note>​ <​note>​
 Hint!  Hint! 
 +
 1.Parent va tine minte si o lista a notificarilor,​ iar Catalog o lista a Observatorilor. 1.Parent va tine minte si o lista a notificarilor,​ iar Catalog o lista a Observatorilor.
  
Line 223: Line 224:
 } }
 public class ScoreVisitor implements Visitor { public class ScoreVisitor implements Visitor {
-  private HashMap<​Teacher,​ ArrayList<​Pair<​Student,​ String,,! Double>>>​ examScores;​ +  private HashMap<​Teacher,​ ArrayList<​Pair<​Student,​ String, Double>>>​ examScores;​ 
-  private HashMap<​Assistant,​ ArrayList<​Pair<​Student,​ String,,! Double>>>​ partialScores;​+  private HashMap<​Assistant,​ ArrayList<​Pair<​Student,​ String, Double>>>​ partialScores;​
   public ScoreVisitor(HashMap<​Teacher,​ ArrayList<​Pair<​Student,​ String, Double>>>​ examScores, HashMap<​Assistant,​ ArrayList<​Pair<​Student,​ String, Double>>>​ partialScores){   public ScoreVisitor(HashMap<​Teacher,​ ArrayList<​Pair<​Student,​ String, Double>>>​ examScores, HashMap<​Assistant,​ ArrayList<​Pair<​Student,​ String, Double>>>​ partialScores){
        ​this.examScores=examScores;​        ​this.examScores=examScores;​
Line 255: Line 256:
  
 <​note>​ Folositi pentru testare main-ul de la **Factory**! </​note> ​ <​note>​ Folositi pentru testare main-ul de la **Factory**! </​note> ​
- +<​hidden>​{{:​poo:​laboratoare:​arhiva_13.zip|Arhiva laborator}} 
-{{:​poo:​laboratoare:​arhiva_13.zip|Arhiva laborator}}+</​hidden>​
  
poo/laboratoare/13.1610904334.txt.gz · Last modified: 2021/01/17 19:25 by carmen.odubasteanu
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0