Question
Answer The Following Questions, Answers must be correct this is for an Exam. 1. List the four main principles of Object Oriented Programming and describe
Answer The Following Questions, Answers must be correct this is for an Exam.
1. List the four main principles of Object Oriented Programming and describe each one in a sentence.
2. Consider a class that contains a private float variable named _secret. Write an Accessor function to get the value of _secret and a Mutator function to change the value of _secret.
3. Specify if the type of class variables (Private, Protected, or Public) that each item can access. Member Functions of a class Friend Functions of a class Functions of a derived class Friend Functions of a derived class Functions of a unrelated class The main function in a program
4. Consider a class the holds a fraction with a numerator and denominator. Provide the declaration for the following operator overloads, do not implement the functions. operator+ for the addition of two fraction objects operator for the subtraction of one fraction object from another operator* for multiplying two fraction objects operator* for multiplying a fraction object by an integer
5. What does the keyword virtual mean in the context of a class?
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