Mod 7 OOP

Daniel Tafmizi

Dr. Friedman

Lis 4370

Module 7


1. How do you tell what OO system (S3 vs. S4) an object is associated with?

Using the function isS4() or isS3() on the object name will tell you which OO system the object was designed under. 

2. How do you determine the base type (like integer or list) of an object?

There are a few useful functions for understanding the storage types of an object. typeof() for storage type, class() for structure type, mode() for data type.

3.What is a generic function?

A function that can be applied to different data and class types. A generic function will have many methods for differing data and class types and call them as needed. 

4. What are the main differences between S3 and S4?

Many differences lie in how operations are called in either class. These differences arise from the fact that S4 objects require explicit class, structure, and inheritance definitions, while S3 do not. I like S4 objects because they remind of classes in python. 

5. In your GitHub, create two examples of S3 and S4.


Output for both:
Name: Daniel 
Age: 20 
GPA: 4

Comments

Popular posts from this blog

redditApiR

Description File