C++ New FINAL II B COM CA
C++ New FINAL II B COM CA
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:
ALGORITHM:
AIM:
To write a program to calculate economic order quantity (EOQ) using
(nesting of member function)
ALGORITHM:
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:
AIM:
To calculate the net income of a family using friend function.
ALGORITHM:
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:
Aim:
To create a program to calculate margin of safety (using multi-level inheritance).
ALGORITHM:
AIM:
To create a program for bank transaction (using constructor and destructor).
ALGORITHM:
AIM:
ALGORITHM:
AIM:
To write a program to create the student file and prepare the mark slip by accessing
the file.
ALGORITHM: