You are on page 1of 5

Department of EEE, Mepco Schlenk Engineering College (Autonomous), Sivakasi

Ex.No.: 3 Name:
FUNCTION OVERLOADING, DEFAULT ARGUMENTS IN C++ -
Date : APPLICATION TO SOLVE ELECTRIC CIRCUITS
Roll no:
Section:
Objective(s):
To implement Function overloading, default arguments in C++ - application to solve electric circuits using
C++ program.

Problem Statement(s):
Implementation of Function overloading and default arguments
 Use the overloaded function to calculate the current through a circuit consisting of three
resistances in series and a 10V source. Overloaded functions can be differentiated using the
number of arguments passed to it.
 Use default arguments to find the power dissipated across the circuit.

19EE351- Object Oriented Programming Laboratory Page 1


Department of EEE, Mepco Schlenk Engineering College (Autonomous), Sivakasi
Test Case Design (Each program must have one valid and one invalid input and their corresponding output):
Program Test Input Test Output Verification
obtained on C++
Example
Program-1

Example
Program-2

code:
Program 1 :

19EE351- Object Oriented Programming Laboratory Page 2


Department of EEE, Mepco Schlenk Engineering College (Autonomous), Sivakasi

Program 2 :

19EE351- Object Oriented Programming Laboratory Page 3


Department of EEE, Mepco Schlenk Engineering College (Autonomous), Sivakasi

19EE351- Object Oriented Programming Laboratory Page 4


Department of EEE, Mepco Schlenk Engineering College (Autonomous), Sivakasi

Discussion on output:

Instructor Comments: Date of Completion

Marks

19EE351- Object Oriented Programming Laboratory Page 5

You might also like