Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I need the answer with toy as real time object Instructions Identify a real-world object such as car, house, toy, computer; or intangible things such
I need the answer with toy as real time object
Instructions Identify a real-world object such as car, house, toy, computer; or intangible things such as profiles, events. Then, design a class which represents the category of that object. Finally, implement it in C++. Class requirements The name of the class must be related to the category of the object such as car, house, toy, computer, event, profile, etc. The class must contain at least 3 attributes (member variables). These must be private. Each attribute must have at least one accessor and one mutator. These must be public. Accessors must have the const access modifier At least one mutator must have a business rule which limits the values stored in the attribute. Examples: a) The attribute can only store positive numbers. b) The attribute can only store a set of values such as "True", "False", "NA". c) The maximum value for the attribute is 100. The class must have at least 2 constructors. The class must have one destructor. The destructor will display "An X object has been removed from memory." where X is the name of the class. Additional private and public member functions can be implemented if needed in the class. Implementation Create h and cpp files to implement the design of the class. Format In a PDF file, present the description of the class. The description must be a paragraph with 50-250 words which explains the class idea or concept. Also, in this document, define the class using a UML diagram. In a h file, present the header of the class. In a cpp file, present the source file of the class. Submission Submit the pdf, cpp, and h files. Example of expected submission GroupCohesiveness.pdf This class design is related to a survey of group cohesiveness where a person (or group of persons) answers 4 questions using a 1-5 Likert scale. The average of the answers is considered the value of group cohesiveness. Group Cohesiveness -answero: int -answer1: int -answer2:int -answer 3: int +setAnswer(int a): void +setAnswer1(int a): void +setAnswer2(int a): void + setAnswer3(int a): void +getAnswerol) const: int +getAnswer1() const: int +getAnswer2) const: int +getAnswer3() const: int +getGroupCohesiveness() const: float GroupCohesiveness() GroupCohesiveness(int a, int a1, int a2, int a3) -GroupCohesiveness) GroupCohesiveness.h #includeStep 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