Answered step by step
Verified Expert Solution
Question
1 Approved Answer
End of Semester 1, 2016 COMP1001 Object Oriented Program Design QUESTION FOUR 20 Marks. For the purposes of this question, assume that you have access
End of Semester 1, 2016 COMP1001 Object Oriented Program Design QUESTION FOUR 20 Marks. For the purposes of this question, assume that you have access to a class called Awning. This class is used to describe all types of awnings. You should assume that the Awning class has all the constructors, accessors and mutators as emphasised in the lecture examples and the worksheet exercises. Design a class called Caravan. Objects of this class are used to describe a caravan and are responsible for the following information: brand: A string containing the manufacturer's brand. awning: An Awning object that is used to describe the awning installed in the caravan. length: A real number in the range 4.0 to 10.0 which specifies the length of the caravan in meters. Two Caravan objects are considered equal if and only if they have the same brand, awning and length. Your design must include all of the good features that have been discussed in the lectures and worksheet exercises. Hint: you should use one mutator for updating all of the state information. Also you may leave out the alternate constructor and the toString accessor. Marks will be allocated for completeness and conformation to best practices. (20 marks ] End of Semester 1, 2016 COMP1001 Object Oriented Program Design QUESTION FOUR 20 Marks. For the purposes of this question, assume that you have access to a class called Awning. This class is used to describe all types of awnings. You should assume that the Awning class has all the constructors, accessors and mutators as emphasised in the lecture examples and the worksheet exercises. Design a class called Caravan. Objects of this class are used to describe a caravan and are responsible for the following information: brand: A string containing the manufacturer's brand. awning: An Awning object that is used to describe the awning installed in the caravan. length: A real number in the range 4.0 to 10.0 which specifies the length of the caravan in meters. Two Caravan objects are considered equal if and only if they have the same brand, awning and length. Your design must include all of the good features that have been discussed in the lectures and worksheet exercises. Hint: you should use one mutator for updating all of the state information. Also you may leave out the alternate constructor and the toString accessor. Marks will be allocated for completeness and conformation to best practices. (20 marks ]
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started