create two supplier classes that interact with each other Program Solution
You’ll create two supplier classes that interact with each other (through a “has a” relationship). Here are UML Class Diagrams for the objects you are to create. Pay attention to the diagram notation indicating whether methods are public (+) or private (-); ask questions if you need clarification. Understanding the model is of critical importance here.
Class Student Class Department (you figure out the private data needed)
(you figure out the private data needed) Constructors
+Student(firstName : String, lastName : String, id : String)
+addStudent(newStudent : Student) : void 3 Constraints and Assumptions
• Create no static methods except for the test methods.
• Mark each instance variable and each method as either public or private; follow the UML where it gives guidance and make smart decisions where it doesn’t.
• Use exactly the method names shown. Look carefully at the parameter data types and the return data types; they give you clues.
• Department’s addStudent method maintains the appropriate total students of each group and the total balance.
• Department’s getTotalGr… methods calculate how many groups need for each class (28 students in the class).
• The toString method should do their best to summarize the state of the object instance in questions; include newlines in the strings to make the result displayable and attractive.
• Create a test method for each class that checks every constructor and every method except toString.
• One credit equals 5, and one credit costs $110.
• Throw an IllegalArgumentException if any of these preconditions are violated: