Answered step by step
Verified Expert Solution
Link Copied!

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 objectimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

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 #include class GroupCohesiveness { private: int answere, answeri, answer2, answers; public: void setAnswere(int a); ve void setAnswer1(int a); vo void setAnswer2(int a); void setAnswer(int a); int getAnswer() const; ut Set Aneu const const; int getAnswer3() const; float getGroupCohesiveness() const; GroupCohesiveness(); GroupCohesiveness(int ab, int al, int az, int a3); GroupCohesiveness(); }; GroupCohesiveness.cpp #include "GroupCohesivness.h" void GroupCohesivness::setAnswer(int a) { if (a>=1 && a=1 && a=1 && a=1 && a

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Business Process Driven Database Design With Oracle PL SQL

Authors: Rajeev Kaula

1st Edition

1795532386, 978-1795532389

More Books

Students also viewed these Databases questions

Question

What do economists mean by self-interest?

Answered: 1 week ago