CS Project File
CS Project File
Record Holder
Acknowledgement
I am greatly indebted to my teacher,
Ms. Urvashi
Students Signature
HOD Computers
CERTIFICATE
This is to certify that Gaurav Bidalia of Class XI - A has
prepared this report file upon the project entitled
Electricity Biller & Record Holder.
The report is a result of his efforts and endeavours. This report is
found worthy of acceptance as final project report for the subject
Computer Science of Class XI. He has prepared the report under
my guidance and evaluation.
(Ms. Urvashi)
HOD (Computer Sciences)
Department of Computer Science,
Ahlcon International School,
Mayur Vihar Ph-1, New Delhi-110092
While n != 4 { }
No
Yes
cin>>n;
if (n==2)
displayp/m/r
if (n==1)
cin >>c[i];
if (n==3)
cin>>ac;
No
No
Yes
Yes
if (n==4)
break;
Yes
Yes
Yes
getch()
Aim of Project
Requirements
(Hardware and Software used)
Macbook Pro 13R (Computing Device)
(Originally experimented in: ) Xcode 7.2 [Build 7C68]
enabled with C++
(Downgraded and executed in: ) Turbo C++ - by Neutron
Pages (software)
Trackpad
Printer
Keynote (software)
Header Files
iostream.h
stdio.h
conio.h
dos.h
Functions
input() -Receiving the data of personnels in the system
amountp()-Calculations for the classes under poor section
displayp()-Display for accounts associated with poor section
searchp()-Searches by comparison of acc number among poor section
amountm()-Calculations for the classes under middle section
displaym()-Display for accounts associated with middle section
searchm()-Searches by comparison of acc number among middle section
amountr()-Calculations for the classes under rich section
displayr()-Display for accounts associated with rich section
searchr()-Searches by comparison of acc number among middle section.
main()-The main initiation of the program and the body where the rest
functions were called. This was the first to be executed.
Source Code
#include<iostream.h>
#include<stdio.h>
#include<conio.h>
#include<dos.h>
#include<stdlib.h>
class EBill
{
private:
char name[100];
protected:
float acc;
public:
void input()
{
delay(100);
cout<<"\nEnter Your name:: ";
gets(name);
delay(100);
cout<<"\nEnter Your account no:: ";
cin>>acc;
}
void display()
{
cout<<"\nYour name is:: "<<name;
cout<<"\nYour acc_no is:: "<<acc;
}
};
class poor: public EBill
{
private:
float unit;
public:
void amountp()
{
input();
cout<<"\nEnter the amount of
electricity:: ";
cin>>unit;
}
void displayp()
{
clrscr();
display();
float k=(unit*4);
float l=(float)15/100 ;
float n=(float)k*l;
float h=(k-n);
cout<<"\nTotal bill in INR is:: "<<h;
}
int searchp(int a)
{
if(a==acc)
{
displayp();
return 1;
}
else return 0;
}
};
class mid: public EBill
{
private:
float unit;
public:
void amountm()
{
input();
};
{
private:
float unit;
public:
void amountr()
{
input();
cout<<"\nEnter the amount of
electricity:: ";
cin>>unit;
}
void displayr()
{
display();
};
float k=(unit*4);
cout<<"\nTotal bill in INR is:: "<<k;
}
int searchr(float c)
{
if(c==acc)
{
displayr();
return 1;
}
else return 0;
}
void main()
{
highvideo();
float ac;
int i,n,j,k,l,a;
poor p[20];
mid m[20];
rich r[20];
clrscr();
while(1)
{
clrscr();
delay(100);
cout<<"\nCode written by: Gaurav Bidalia &
Durgansh Taneja";
cout<<"\nClass : XI";
cout<<"\nSection : A";
\n";
p[i].searchp(ac);
if(a==1)
break;
}
if(c[i]=='m')
{
m[i].searchm(ac);
if(a==1)
break;
}
if(c[i]=='r')
{
r[i].searchr(ac);
if(a==1)
break;
}
}
getch();
break;
case 4:
break;
default:
cout<<"\nInvalid option\n" <<
"**************";
delay (3500);
break;
}
if(n==4)
exit(0);
}
getch();
}
/*
All values are represented for a month of usage and are billed for that
~~~~~~~~~month only~~~~~~~~~~
End of Program
*/
b) Input page with the details stored in the program being shown.
c) The details of the account are flashed on the screen along with calculated bill for
the month.
d) Search field accepting the account number which redirects to display its value.
The program can contain information for numerous number of accounts and this
search therefor enables quick location of the data.
Bibliography
LearnCPP Foundation :-
http://www.learncpp.com/cpp-tutorial/1-4a-a-first-look-atfunction-parameters/