Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Hi this is my third time posting this. Can someone help me. I would really appreciate it!! Is A vs. Has A Corresponding Material Classes
Hi this is my third time posting this. Can someone help me. I would really appreciate it!!
Is A vs. Has A Corresponding Material Classes and Object-Oriented Programming Discussion Large programs are often built using multiple classes. For example, a Program might have 3 different classes, a Person class, a Student class, and a Worker class. Within this program, we may see several different relationships. Person Name Birthday Student Grade School Worker Job Title Salary HAS A relationships: A Person HAS A Name. A Student HAS A Grade. A Worker HAS A Salary. IS A relationships: A Student IS A Person. A Worker IS A Person. "Has A' relationship takes on significance in our coding project. Values that use a "has a" relationship represent instance variables in our code. 'Is A' relationships also take on significance. 'Is A' is used when one thing is a more specific version of another thing. These represent class hierarchies. Exercise 1. In the following examples, fill in the relationship between the fields as either a 'Has A or an 'Is A': Chicago Car Orange city. tire. color. name. Dog Dog animal. Circle shape. Square width. Recipe ingredient. 2. Think of additional Is A Relationships. Write down 5 additional examples and take note of which one is a more specific version of the other. Specific General Example: Tesla Example: Car 1. 1. 2. 2- 3. 3. 4. 4. 5. Are these relationships symmetrical? In other words, can we say that 'All Teslas are Cars' and 'All Cars are Teslas"? Are any of the relationships above symmetrical 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