Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

This study guide questions that need to be answered by saturday 3/19/16 . Its fo

ID: 3678980 • Letter: T

Question

This study guide questions that need to be answered by saturday 3/19/16 . Its for an important test. Please provide the answers to the questins below.

What is the fundamental principles of object-oriented design (OOD)?

How do you identify a member in the UML class diagram as public, private and protected?

What’s different between public, private and protected member functions of a class?

How Static member variables work?

Constructor and destructor of the class

Class Inheritance and how the member access specifier (public, private and protected) works.

What are accessor and mutator functions?

How reference and value parameters of a function work?

What is the purpose of using virtual functions? How it works?

Why do we inherits a class from existing class?

What’s different between function override and overload?

How to call a base class function from derived class?

What does ADT for?

What’s difference between class and structs?

What’s the difference between shallow and deep copy?

How the copy constructor works?

How address of and dereferencing operator works?

What you need to do when using dynamic pointers?

Pointer arithmetic

What is memory leak, how does it happens?

Explanation / Answer

1 Fundamental principle for OOD desgine:

1.Single-responsibility Principle..

A class should have one and only one reason to change, meaning that a class should have only one job.

2.Open-closed Principle:

Objects or entities should be open for extension, but closed for modification.

3.Liskov substitution principle:Let q(x) be a property provable about objects of x of type T. Thenq(y) should be provable for objects y of type S where S is a subtype of T

4.interface segregation principle

A client should never be forced to implement an interface that it doesn’t use or clients shouldn’t be forced to depend on methods they do not use.

5.Dependency Inversion principle:

Entities must depend on abstractions not on concretions. It states that the high level module must not depend on the low level module, but they should depend on abstractions.

2.identifieng access specifier ofwr memberin class diagram:

public:+

private:-

protected:# classs member has these symbols as prefix.

3.static member variable:

the use of static inside a function is the simplest. It simply means that once the variable has been initialized, it remains in memory until the end of the program.static variable unchanges its value untill program ends

4.constructor and destructor of the class:

constructor is a kind of member function that initializes an instance of its class.

A constructor has the same name as the class and no return value.

destructor is a special member function of a class that is executed whenever an object of it's class goes out of scope

5.class inheritance:

inheritance means using super class properties in sub class or child class.

if access specifier is public any class can inherits superclass

if access specifier is private only members of that super class can derive

if access specifier protect it is same as private only sub classes can inherits

6.accesor and mutator:

mutator method is a method used to control changes to a variable. They are also widely known as setter methods. Often a setter is accompanied by a getter (also known as an accessor), which returns the value of the private member variable.

7.reference and value parameters:

if a parameter is passed by reference, that value shares the same memory location as the actual value.

8.virtual function:

If there are member functions with same name in base class and derived class, virtual functions gives programmer capability to call member function of different class by a same function call depending upon different context.

ex:display() is virtual function we call by A and B class objects:

A object1,B object2

A.display();

B.display();

9.inheritence:we inherit child class from parent or base class for to get all base class properties to sub class

10.function override and overload:

If a derived class requires a different definition for an inherited method, then that method can be redefined in the derived class. This would be considered overriding.

methode overloading means function has same name and different parameters.function call based on parameter list

11.base class callfrom derived class:

base class name ::functionname();

ex: base::display();

12.ADT:an abstract data type (ADT) is a mathematical model for data types where a data type is defined by its behavior from the point of view of a user of the data, specifically in terms of possible values, possible operations on data of this type, and the behavior of these operations.

13.class vs struct:

Class

Structure

13.shallow and deepy copy:

A deep copy is used for objects that are returned from a function. A deep copy copiesall fields, and makes copies of dynamically allocated memory pointed to by the fields. Adeep copy occurs when an object is copiedalong with the objects to which it refers.

Shallow copy is a bit-wise copy of an object

14.copy constructor:The copy constructor is a constructor which creates an object by initializing it with an object of the same class, which has been created previously. The copy constructor is used to: Initialize one object from another of the same type. Copy an object to pass it as an argument to a function.

15.address of and derefeeerencing:

An address-of operator is a mechanism within C++ that returns the memory address of a variable. These addresses returned by the address-of operator are known as pointers, because they "point" to the variable in memory.

int *p; would define a pointer to an integer, and *p would dereference that pointer, meaning that it would actually retrieve the data that p points to.

16.dynamic pointer:

Dynamic memory is allocated using operator new . new is followed by a data type ... It returns apointer to the beginning of the new block of memory allocated.

17.pointer arithamatic:A pointer in c is an address, which is a numeric value. Therefore, you can perform arithmetic operations on a pointer just as you can on a numeric value. There are four arithmetic operators that can be used on pointers: ++, --, +, and

18.memory leak:A memory leak is the gradual loss of available computer memory when a program repeatedly fails to return memory that it has obtained for temporary use.

memory leak occurs when a piece (or pieces) of memory that was previously allocated by a programmer is not properly deallocated by the programmer

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote