0% found this document useful (0 votes)
23 views65 pages

C++ New FINAL II B COM CA

The document outlines various programming tasks in C++ related to financial calculations and data management, including depreciation methods, economic order quantity, payroll statements, interest calculations, and library management. Each task includes an aim and a step-by-step algorithm for implementation using Turbo C++ editor. The tasks involve concepts such as classes, member functions, inheritance, operator overloading, and file operations.

Uploaded by

scasdrmms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
23 views65 pages

C++ New FINAL II B COM CA

The document outlines various programming tasks in C++ related to financial calculations and data management, including depreciation methods, economic order quantity, payroll statements, interest calculations, and library management. Each task includes an aim and a step-by-step algorithm for implementation using Turbo C++ editor. The tasks involve concepts such as classes, member functions, inheritance, operator overloading, and file operations.

Uploaded by

scasdrmms
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 65

DEPRECIATION

(OUTSIDE THE CLASS)

AIM:
To write a program to calculate depreciation under straight line method of
diminishing method cursing class, member functions outside the class.

ALGORITHM:
Step 1: Open turbo C++ editor.
Step 2: Create a new C++ file.
Step 3: Declare a class “depreciation” write required variables and member functions.
Step 4: Using the member function calculate necessary value for straight line method
and diminishing balance method using their own formulas.
Step 5: Save the file using F2 key and compile it using (Alt+F9) key and if error it
using to find rectify it and run the program using (Ctrl+F9) key.

1.
CODING:
#include<iostream.h>
#include<conio.h>
Class depreciation
{
Long int value, scrap, year;
Float per, dep, cost;
Public:
Void getvalue();
Void getdata();
Void straight();
Void dimmethod();
};
Void depreciation::getdata()
{
Cout<<\n enter the cost of machinery\t:rs”;
Cin>>value;
Cout<<\n enter the percentage\t:”;
Cin>>per;
Cout<<\n enter the number of years:\t”;
Cin>>year;
}
Void depreciation ::dimmethod()
{
Int i;
For(i=1;i<=year;i++)
{
Dep=value*per/100;
2.DEPRECIATION-DIMINISHING BALANCE METHOD

AIM:

To write a program to calculate depreciation under diminishing balance method


(class, member function inside the class)

ALGORITHM:

*open the turbo c++ editor.


*create a new c++ file.
*declare a class depreciation with required variables and member function.
*using member function calculate necessary values for diminishing balance method
using its formula.
*save the file using (f2) key and then compile the file using (Alt+F9) key and rectify
the errors.
*finally run the program using (Ctrl+F9).
3.ECONOMIC ORDER QUANTITY

AIM:
To write a program to calculate economic order quantity (EOQ) using
(nesting of member function)

ALGORITHM:

*open the turbo c++ editor.


*create a new c++ file.
*declare a class measure with required variables and member function
*using member function get the input for the consumption, order quantity and
inventory cost and find the economic order quantity using the formula.
*EOQ = (2*C*o)/i
*Then save the file using (f2)
*compile the file using (ALT+F9) and rectify the errors
*finally run the program using (ctrl+F9).
4.EMPLOYEE’S PAYROLL STATEMENTS
[USING CONTROL STRUCTURE]
AIM:
To print the employee payroll statement (using control structure).

ALGORITHM:
*Open turbo c++ editor.
*create a new c++ file.
*Declare a class structure with required variables and member functions using get
details get the employees payroll statement, using formula in different cases.
*Using the net salary function calculate the net of the employees.
*Using the employers details functions calculate the pay slip of employees.
*Then save the file using [F2] and compile the file using (Alt+F9) and rectify it.
*finally run the program using (Ctrl+F9).
5. SIMPLE INTEREST AND COMPOUND INTEREST
[USING NESTED CLASS]

AIM:
To calculate simple and compound interest [using nested class].

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*declare a class another class ”interest”.
Which is derived from class “interest”.
*using print () calculate simple interest and compound interest.
*save the file and compile and run the program.
*stop the process.
6.NET INCOME OF A FAMILY
(USING FRIEND FUNCTION IN TWO CLASS)

AIM:
To calculate the net income of a family using friend function.

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*declare a class income with required variable members function and friend function.
*using friend function to calculate net income net income of the family.
*save the file and compile and run the program.
*stop the process.
7.LIBRARY BOOKS
(USING ARRAY OF OBJECT)

AIM:
To prepare the book list of library using array of object.

ALGORITHM:
*Start the process.
*open turbo C++ editor.
*create a new C++ file.
*declare a class library with required variable and member function.
*Using getdata() get the details of the book.
*using display() display the book editor.
*save the file and compile and run the program.
*stop the process.
8.COST SHEET.
(USING INHERITANCE)

AIM:
To create a program to prepare cost sheet (using inheritance concept).

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*declare a class cost with required variables and member function.
*Declare a another class named class1 which is derived from cosrt.
*Another class names class2 which is derived from class1.
*using the required function calculation profit and loss
*save the file and compile and run the program.
*stop the process.
9.MARGIN OF SAFETY
(USING MULTILEVEL INHERITANCE)

Aim:
To create a program to calculate margin of safety (using multi-level inheritance).

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*create a three classes named such as margin marginal and margin which required
variables and member function.
*Calculate margin of safety using the concept the multi-level inheritance
*save the file and compile and run the program.
*stop the process.
10.BANK TRANSACTION
(USING CONSTRUCTOR &DESTRUCTOR)

AIM:
To create a program for bank transaction (using constructor and destructor).

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*create a class named ”bank” with required varliables and constructors.
*using constructor, balance and withdrawal initializing with zero.
*using display () calculate the account balance.
*save the file and compile and run the program.
*stop the process.
11. WORKING CAPITAL
( USING OPERATOR OVERLOADING)

AIM:

To write a program to calculate increase on decrease in working capital (using


operator overloading).

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*create a class “use” which required variables and member function.
*declare ooperator ().
*using show () calculate working capital.
*save the file and compile and run the program.
*stop the process.
12.STUDENT MARK STATEMENT
(USING FILE OPERATION)

AIM:

To write a program to create the student file and prepare the mark slip by accessing
the file.

ALGORITHM:

*Start the process.


*open turbo C++ editor.
*create a new C++ file.
*In a function main () object of stream classes.
*using the object and display the content.
*close the stream classes and close the file.
*save the file and compile and run the program.
*stop the process.

You might also like