C/C++

Create Pattern, Print Series, Working with Records, Use Numeric Functions, Work with arrays

Submitted by deepak.gupta1501 on
The objective of this assignment is to develop a menu driven application that will enable the user to use its different features to print various series, work with records and arrays, create patterns, use number functions and exit the application. The application should provide the following options in the main menu, however this menu is further classified into another menus:- • Create Pattern •

Polymorphism

Submitted by Muzammil Muneer on

Polymorphism

In this part you will learn: 1. What is polymorphism 2. Why need polymorphism 3. What is virtual function 4. What is pure virtual function 5. Program 6. Output Polymorphism Polymorphism means having many forms. In c++, when we are dealing with classes and their inheritance, there occurs a case when we have more than one derived classes of the base class. Using polymorphism we can call a member function, which will, depending upon the type of object that invokes the function, cause a different function to perform. Polymorphism makes the program simple.

Overriding Function

Submitted by Muzammil Muneer on

Overriding function

In this part you will learn: 1. What are overriding functions? 2. What are the benefits of using overriding functions? 3. How to override a function 4. Program 5. Output Overriding function A function of base class defined again in the derived class is known as overriding function. In many c++ programs, there comes a case when we want to add extra functionality in the base class. So we override the function.

Inheritance

Submitted by Muzammil Muneer on

Inheritance

In this part you will learn: 1. What is inheritance? 2. Why we need inheritance? 3. Syntax 4. Program 5. Output Inheritance In c++, the concept of inheritance is just like inheritance in family. As we all are child of our parents, we have inherited their many things from them. Similar is the case in programming.

Operator Overloading

Submitted by Muzammil Muneer on

Operator overloading

In this part you will learn: 1. What is meant by operator overloading 2. Why we need to overload operators 3. Syntax 4. Program 5. Output Operator Overloading As the name suggests, operator overloading means to make overloaded function for an operator of a class. There are many operators in programming the basic ones are given below • logical operators(,>,=,>=,==,!=) • Arithmetic operators(+,-,*,/,%) • unary operators (++,--) • assignment operator (=) etc. We can even overload console input and output operators.

Friend Functions

Submitted by Muzammil Muneer on

Friend functions

In this part you will learn: 1. What are friend functions 2. Uses of friend function 3. Syntax of friend function 4. Program 5. Output Friend Function A function declared as friend function isn’t really a part of member functions of a class but it can access the public as well as the private members of the class which considers the function as its friend.

Constant members and Objects

Submitted by Muzammil Muneer on

Constant members and Objects

In this part you will learn: 1. What are constant data members and functions 2. How to use them 3. Syntax in c++ 4. Program 5. Output Constant data members Constant data members are the data members of a class which once initialized, cannot be changed during any part of the program. Constant data members are declared just like normal data member declaration, the only difference is that we add a keyword ‘const’ before it.

Member Function’s Definition Outside Class

Submitted by Muzammil Muneer on

Member function’s definition outside Class

In this part you will learn: 1. Why we need to define function outside class 2. Syntax 3. Scope resolution operator 4. Program Defining Member function outside Class Till now, we have written many programs using class in the previous topic. In those classes, we had member functions too. Those member functions were defined right there because of their small size. But think about a huge project, with hundreds of member functions of a single class.

Passing and Returning of Objects To and From Functions

Submitted by Muzammil Muneer on

Passing and Returning of objects to/from Functions

In this part you will learn: 1. How to pass objects to a function 2. Arrow operator 3. Syntax of passing an object 4. How to return an object from a function 5. Syntax of returning an object 6. Program with object passing and returning 7. Output Passing an Object to Function Just like built-in data types like int, char, float , user-defined class’s object can be passed to a function in c++.