Telephone · Web viewMany other programming languages have been influenced by C++, including C#,...

33
Telephone Bill 2015-16 JAWAHAR NAVODAYA VIDYALAYA NANDLA AJMER MAHESH SONI Page 1

Transcript of Telephone · Web viewMany other programming languages have been influenced by C++, including C#,...

Page 1: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

JAWAHAR NAVODAYA VIDYALAYANANDLA AJMER

COMPUTER SCIENCE INVESTIGATORY 2015-2016

MAHESH SONI Page 1

Page 2: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

CERTIFICATEThis is to certify that the project report entitled

“Telephone bill”Done by Master MAHESH SONI class XII, reg.no

1615733. is an authentic work carried out by him in JNV

NANDLA AJMER for the academic year 2015-16. This

project is in fulfillment of the requirements for appearing

in AISSC examination, March 2016.

Mr. Mohd. Shahid

(PGT COMPUTER SCIENCE)

External Examiner Principal

MAHESH SONI Page 2

Page 3: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

CONTENTS ACKNOWLEDGEMENT

INTRODUCTION

REASON FOR SELECTION

CERTIFICATE

SOURCE CODE

SCREEN SHOTS

BIBLIOGRAPHY

MAHESH SONI Page 3

Page 4: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

ACKNOWLEDGEMENTIt is with great pleasure I am expressing my gratitude to those who has helped me a long way in completing my project.

I hereby whole heartedly thank my computer teacher Mr. Mohammad Shahid (PGT CS) and Mrs. Vibhuti Jain (FCSA) for their guidance and support. And it is of great pleasure to express my deep sense of gratitude to the Principal Mr.S.K.Maheshwari, teachers and friends for their inspiration and constant help during the project. I thank all my classmates who helped me during the development of this project with their constructive criticism and advice.

I would also like to thank my parents for encouraging me during this course of this project. Finally I would like to thank MAHESH SONI Page 4

Page 5: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

CBSE for giving me this opportunity to undertake this project.

REASON FOR SELECTION

C++ has always inspired me as a programming language and I have deep interest in knowing about the methodologies used in this program. As I want to do a project file I was happy to explore the unique features of this programming language.I was also interested to know about the functioning of telephone billing system and thus I decided to take it as my project topic. Hence I present here the result of my work “telephone billing”.

MAHESH SONI Page 5

Page 6: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

INTRODUCTIONC++ is a general purpose language. It has imperative, object oriented and generic programming features, while also providing the facilities for low level memory manipulation.It is designed with a bias for systems programming (e.g. embedded systems, operating system kernels), with performance, efficiency and flexibility of use as its design requirements. C++ has also been found useful in many other contexts, including desktop applications, servers (e.g. e-commerce, web search, SQL), performance critical applications (e.g.

MAHESH SONI Page 6

Page 7: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

telephone switches, space probes) and entertainment software, such as video games. It is a compiled language, with implementations of it available on many platforms. Various organizations provide them, including the FSF, LLVM, Microsoft and Intel.C++ was developed by BjarneStroustrup at Bell Labs, starting in 1979, who wanted an efficient flexible language (like C) that also provided high level features for program organization.Many other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998).

Source Code// project of telephone bill//by prafful and Mahesh #include<fstream.h>#include<conio.h>#include<stdio.h>#include<string.h>

MAHESH SONI Page 7

Page 8: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

#include<iomanip.h>class tele{char name[20],adr[25],ld[10],dt[10];long int telno,tc; public: void add(); void delee(); void modify(); void display(); void detail(); void printbill(); void screen(); void screen1();}obj;

// Adding new data void tele::add() { fstream file; file.open("Bill.dat",ios::app|ios::binary); clrscr(); char ans; do { screen(); gotoxy(30,5);cout<<" ADD DATA "; gotoxy(30,6);cout<<" -------- "; gotoxy(20,9);cout<<"Name : ";gets(name); gotoxy(20,10);cout<<"Address : ";gets(adr); gotoxy(20,11);cout<<"Last Due Date : ";gets(ld);

MAHESH SONI Page 8

Page 9: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

gotoxy(20,12);cout<<"Tele Phone No : ";cin>>telno; gotoxy(20,13);cout<<"Totel Calls : ";cin>>tc; gotoxy(20,14);cout<<"Bill Date : ";gets(dt); file.write((char*)&obj,sizeof(obj)); screen(); gotoxy(35,15);cout<<" Enter any more records (Y/N) ? "; ans=getch(); } while(ans=='y'); }

// Deleting data void tele::delee() { clrscr(); int flag; long int tn; char ans,ans1; do { flag=0; screen(); fstream file,file1; file.open("Bill.dat",ios::in|ios::binary); file1.open("Bill.dat",ios::app|ios::binary); gotoxy(21,7);cout<<" Deleting of Records "; gotoxy(21,8);cout<<" ------------------- "; gotoxy(15,10);cout<<" Enter Telephone No whose record is to be deleted "; cin>>tn; ans1 = ' ';

while(file)

MAHESH SONI Page 9

Page 10: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

{ file.read((char*)&obj,sizeof(obj)); if(tn==telno) {

flag=1;gotoxy(12,13);cout<<"Telephone No : "<<telno;gotoxy(12,14);cout<<"Name "<<name;gotoxy(12,15);cout<<"Adress : "<<adr;gotoxy(12,16);cout<<"Total Calls : "<<tc;gotoxy(12,17);cout<<"Last Due Date : "<<ld;gotoxy(12,18);cout<<"Bill Date : "<<dt;gotoxy(15,20);cout<<"Do you want to delete this

record (Y/N) ? ";ans1=getchar();

} if((ans1=='n') || (tn!=telno)) { file1.write((char*)&obj,sizeof(obj)); }

} screen(); if(flag==0)

{ gotoxy(20,10);cout<<"This record does not exist. "; gotoxy(50,24);cout<<"Press any key to continue. "; getch();}

elseif(flag==1 && ans1=='y') { gotoxy(20,12);cout<<" Record is deleted";

MAHESH SONI Page 10

Page 11: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

// gotoxy(50,24);cout<<"Press any key to continue.";// getch();

} file.close(); file1.close();

file.open("Bill.dat",ios::out|ios::binary); file1.open("Bill.dat",ios::in|ios::binary); while(file1) { file1.read((char*)&obj,sizeof(obj)); file.write((char*)&obj,sizeof(obj)); } file1.close(); file.close();

gotoxy(35,18);cout<<"Any more record to delete (Y/N) ? "; ans=getch(); } while(ans=='y');}

// Modify Recordvoid tele::modify() { int flag; long int tn; char ans; fstream file,file1; do { clrscr();

MAHESH SONI Page 11

Page 12: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

screen(); gotoxy(15,7);cout<<" Editing of Records "; gotoxy(15,8);cout<<" ------------------ "; file.open("Bill.dat",ios::in|ios::binary); file1.open("Bill.dat",ios::out|ios::binary); gotoxy(20,12);cout<<" Enter Telephone No whose record is to be Edited "; cin>>tn; while(file) { flag=0; file.read((char*)&obj,sizeof(obj)); if(telno==tn) {

flag=1;screen();gotoxy(15,8);cout<<"Enter Modified Data ";gotoxy(15,10);cout<<"Name : ";gets(name);gotoxy(15,11);cout<<"Address : ";gets(adr);gotoxy(15,12);cout<<"Total Calls : ";cin>>tc;gotoxy(15,13);cout<<"Telephone No : ";cin>>tn;gotoxy(15,14);cout<<"Last Due Date : ";gets(ld);gotoxy(15,15);cout<<"Bill Date : ";gets(dt);

file1.write((char*)&obj,sizeof(obj)); } } if(flag==0) { screen(); gotoxy(20,12);cout<<"Record does not exist. "; gotoxy(50,24);cout<<"Enter any key to continue.";

MAHESH SONI Page 12

Page 13: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

getch(); } file.close(); file1.close();

file.open("Bill.dat",ios::out|ios::binary); file1.open("Bill.dat",ios::in|ios::binary); while(file1) {

file1.read((char*)&obj,sizeof(obj));file.write((char*)&obj,sizeof(obj));

} file.close(); file1.close(); screen(); gotoxy(15,20);cout<<"Any more record to modify (Y/N) ? "; ans=getchar(); } while(ans!='n'); }

// Details of Bill System void tele::detail() { clrscr(); screen(); gotoxy(15,7);cout<<" Details of telephone Bill System "; gotoxy(15,8);cout<<" -------------------------------- "; gotoxy(15,10);cout<<"This project is on the preparation of Telephone Bills";

MAHESH SONI Page 13

Page 14: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

gotoxy(15,11);cout<<"you are required to input following information"; gotoxy(20,13);cout<<"(1) Client's Telephone No - telno"; gotoxy(20,14);cout<<"(2) Client's Name - name"; gotoxy(20,15);cout<<"(3) Client's Address - adr"; gotoxy(20,16);cout<<"(4) Total Calls - tc"; gotoxy(20,17);cout<<"(5) Last Due Date - ld"; gotoxy(20,18);cout<<"(6) Bill Date - dt"; gotoxy(45,22);cout<<"Press any key to continue "; getch(); }

//Display records void tele::display() { fstream file; clrscr(); gotoxy(32,2);cout<<"View All Records"; gotoxy(32,3);cout<<"----------------"; file.open("Bill.dat",ios::in|ios::binary); gotoxy(1,5);cout<<"Client's Name"; gotoxy(20,5);cout<<"Phone No "; gotoxy(33,5);cout<<"Address "; gotoxy(49,5);cout<<"Calls "; gotoxy(57,5);cout<<" Due Date"; file.read((char*)&obj,sizeof(obj)); while(file)

{ cout<<"\n"<<name<<"\t\t "<<telno; cout<<"\t"<<adr; cout<<"\t\t"<<tc;

MAHESH SONI Page 14

Page 15: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

cout<<"\t"<<ld; file.read((char*)&obj,sizeof(obj)); }

gotoxy(50,50);cout<<"\nPress any key to continue"; getch(); }

// Printing Bill void tele::printbill() { int nc; float ba,msc,ta,eba; clrscr(); fstream file; file.open("Bill.dat",ios::in|ios::binary); file.read((char*)&obj,sizeof(obj)); while(file) { ba=0.0; nc=0; eba=msc=0; if(tc>150 && tc<250) { nc=tc-150; ba=0.8*(tc-150); } else if(tc>250) {

nc=tc-150;ba=2*(tc-250)+80;

MAHESH SONI Page 15

Page 16: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

} else { nc=0; } msc=0.05*(ba+360); ta=ba+360+msc; eba=ta+20; screen1(); gotoxy(30,4);cout<<"BHARAT SANCHAR NIGAM LIMITED"; gotoxy(30,5);cout<<" AJMER, RAJASTHAN"; gotoxy(30,6);cout<<" ----------------"; gotoxy(38,7);cout<<"TELEPHONE BILL"; gotoxy(38,8);cout<<"--------------"; gotoxy(20,9);cout<<"To"; gotoxy(23,10);puts(name); gotoxy(23,11);puts(adr); gotoxy(23,12);cout<<"------------------------------------------"; gotoxy(23,13);cout<<"Telephone No."; gotoxy(39,13);cout<<"Bill Date"; gotoxy(53,13);cout<<"Payable Upto"; gotoxy(23,14);cout<<telno; gotoxy(39,14);cout<<dt; gotoxy(53,14);cout<<ld; gotoxy(23,15);cout<<"------------------------------------------"; gotoxy(23,16);cout<<"Gross Calls "; gotoxy(39,16);cout<<"Free Calls "; gotoxy(53,16);cout<<"Net Calls "; gotoxy(25,17);cout<<tc; gotoxy(40,17);cout<<"150"; gotoxy(55,17);cout<<nc;

MAHESH SONI Page 16

Page 17: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

gotoxy(23,18);cout<<"------------------------------------------"; gotoxy(23,19);cout<<"Rental Amount:- 360"; gotoxy(45,19);cout<<"Call Charges:- "<<ba; gotoxy(23,20);cout<<"Misc. Amount :- "<<msc; gotoxy(45,20);cout<<"Total Amount:- "<<ta; gotoxy(23,22);cout<<"Amount after Due Date :- "<<eba; file.read((char*)&obj,sizeof(obj)); gotoxy(45,24);cout<<"Press any key to continue"; getch(); } file.close(); } void main() { int ch; do { clrscr(); obj.screen(); gotoxy(30,5);cout<<"TELEPHONE BILL SYSTEM"; gotoxy(30,6);cout<<"---------------------"; gotoxy(25,8);cout<<"1. Details of Bill System"; gotoxy(25,10);cout<<"2. Add New Phone Connection"; gotoxy(25,12);cout<<"3. Delete Phone Connection"; gotoxy(25,14);cout<<"4. Modify Record"; gotoxy(25,16);cout<<"5. Display Records"; gotoxy(25,18);cout<<"6. Print Bill"; gotoxy(25,20);cout<<"7. Exit"; gotoxy(23,22);cout<<"Enter your choice < 1 to 7 > "; cin>>ch; switch(ch)

MAHESH SONI Page 17

Page 18: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

{ case 1:

obj.detail(); break;

case 2: obj.add(); break;

case 3: obj.delee(); break;

case 4: obj.modify(); break;

case 5: obj.display(); break;

case 6: obj.printbill(); break;

case 7: clrscr(); obj.screen(); gotoxy(35,14),cout<<"T H A N K Y O U"; gotoxy(35,15),cout<<"----------------"; gotoxy(45,22),cout<<"Press any key to continue"; getch(); break;

default:clrscr();obj.screen();gotoxy(35,15);cout<<"Invalid Choice !";

MAHESH SONI Page 18

Page 19: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

gotoxy(50,24);cout<<"Press any key to continue";getch();

} } while(ch!=7); }

void tele::screen() { clrscr(); int i,j; for(i=4;i<=24;i++) { gotoxy(10,i);cout<<'*'; gotoxy(75,i);cout<<'*'; } for(j=10;j<=75;j++) { gotoxy(j,4);cout<<'*'; gotoxy(j,24);cout<<'*'; } } void tele::screen1() { clrscr(); int i,j; for(i=3;i<=25;i++) { gotoxy(15,i);cout<<'*'; gotoxy(75,i);cout<<'*'; } for(j=15;j<=75;j++)

MAHESH SONI Page 19

Page 20: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

{ gotoxy(j,3);cout<<'*'; gotoxy(j,25);cout<<'*'; } }

OUTPUT

MAHESH SONI Page 20

Page 21: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

MAHESH SONI Page 21

Page 22: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

MAHESH SONI Page 22

Page 23: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

MAHESH SONI Page 23

Page 24: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

MAHESH SONI Page 24

Page 25: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

MAHESH SONI Page 25

Page 26: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

Bibliography

Computer science C++ for class XII Sumitra Arora

C++ by Balaguruswamy www.cppforschool.com

MAHESH SONI Page 26

Page 27: Telephone · Web viewMany other programming languages have been influenced by C++, including C#, Java, and newer versions of C (after 1998). Source Code // project of telephone bill

Telephone Bill 2015-16

www.google.com

MAHESH SONI Page 27