For the partial fulfillment of CBSE Exam Made By: Ashish kumar jha Class : XII Science Roll No :

Size: px
Start display at page:

Download "For the partial fulfillment of CBSE Exam Made By: Ashish kumar jha Class : XII Science Roll No :"

Transcription

1 For the partial fulfillment of CBSE Exam. 201 Made By: Ashish kumar jha Class : XII Science Roll No :

2 Certificate This is to certify that the project entitled employee management system which deals with the employee s useful information, their marks and various operations related to it, is being submitted by Ashish kumar jha. The project is bonafide piece of work carried out with the consultation of the supervisor.

3 Acknowledgement It is with great pleasure that I find myself penning down these lines to express my sincere thanks to various people who helped me a long way in completing this project. The harmonious climate in our school provided guide for preparing the project. It was a privilege to have been guided by MR. Mukesh Prasad. Thanks to my teacher who helped me during the development of this project with his constructive criticism with support and advice.

4 //employee management system #include <graphics.h> // graphics functions #include <fstream.h> // for file handling #include <stdio.h> #include <conio.h> #include <string.h> #include <dos.h> #include <iomanip.h> struct date_rec // record to get date short int dd; short int mm; int yyyy; current_date; // this class defines data related to monthly pay file class payfile private : unsigned long emp_num; char emp_name[25]; char emp_designation[10]; int days_worked; float basic_pay; float DA; float HRA; float CCA; float con_veyance; float gross_pay; float PF; float income_tax; float other_deductions; float net_pay; public: payfile() // no argument constructor days_worked = 0; basic_pay = DA = HRA = CCA = con_veyance = gross_pay = 0.0; PF = income_tax = other_deductions = net_pay = 0.0;

5 void get_pay(); // this function reads the private members of payfile void update_pay_file(); // generate monthly pay file friend void add_object(); // register a new employee in pay file friend void del_object(); // deletes an employee from pay file friend void reports(); // generate salary statements pay; void payfile::get_pay() // this function reads the private members of payfile cout<<"\n\n ENTER THE BASIC SALARY >"; cin>>basic_pay; cout<<"\n ENTER THE NO. OF DAYS WORKED ----->"; cin>>days_worked; cout<<"\n ENTER THE DEARNESS ALLOWENCE ----->"; cin>>da; cout<<"\n ENTER THE HOUSE RENT ALLOWENCE --->"; cin>>hra; cout<<"\n ENTER CCA >"; cin>>cca; cout<<"\n ENTER THE CONVEYENCE ALLOWENCE --->"; cin>>con_veyance; cout<<"\n ENTER PF >"; cin>>pf; cout<<"\n ENTER THE INCOME TAX >"; cin>>income_tax; cout<<"\n ENTER OTHER DEDUCTIONS >"; cin>>other_deductions; gross_pay = basic_pay + DA + HRA + CCA + con_veyance; net_pay = gross_pay - ( PF + income_tax + other_deductions ); gotoxy(22,24); cout<<" PRESS ANY KEY TO CONTINUE "; getch(); clrscr(); void payfile::update_pay_file() fstream file; file.open("payfile.dat",ios::in ios::out); // open pay file in I/O mode file.seekg(0,ios::beg); // set file pointer to the begining of the file

6 file.read((char*)&pay,sizeof(pay)); // read the first record int n = file.tellg(); // find where file pointer is while(!file.eof() ) clrscr(); // clear screen cout<<"\n ENTER DATA FOR EMPLOYEE NO > "<<pay.emp_num; pay.get_pay(); // get pay data file.seekg(n-sizeof(pay)); // set file pointer to the correct position file.write((char*)&pay,sizeof(pay)); // write pay data in the file file.flush(); file.seekg(n); // set file pointer to next record file.read((char*)&pay,sizeof(pay)); // read next record n = file.tellg(); // find position of file pointer file.close(); // close monthly pay file // this class defines the data and member functions related to employee file class employee private : unsigned long employee_num; char employee_name[25]; char employee_address[35]; date_rec date_joining; date_rec date_birth; char desig_nation[10]; float basic_salary; public: char ch; // this function generates record no. automatically unsigned long get_rec_no(); // this function get a record from the operator void get_data(); void show_data(); // this function displays data // this function adds a record to the master file friend void add_object();

7 //this function shows all the records void show_object(); // this function deletes a record friend void del_object(); // this function modifies a record void modify_object(); // this function generates reports friend void reports(); // this function searches infornmation on the basis of a given field void search_object(); emp; // object list // this function generates record no.automatically unsigned long employee:: get_rec_no() int found = 0; unsigned long recno,temp_recno; struct node // structure to make an index of the record nos. unsigned long rec_no; node *link; // pointer to next node ; node *start,*ptr,*ptr1,*ptr2; // pointers to node fstream infile; infile.open("employee.dat",ios::in); // open file in input mode infile.seekg(0,ios::end); // set file pointer to the begining of the file int n = infile.tellg(); // get no. of bytes in the file infile.close(); // close file if( n == 0) // if file is empty recno = 1; else // get all record nos. in a linked list infile.open("employee.dat",ios::in); // open file for reading start = ptr = new node; // get new node from operating system infile.seekg(0,ios::beg); // set file pointer to the begining of the file infile.read((char*)&emp,sizeof(emp)); // read first record

8 while(!infile.eof()) ptr->rec_no = employee_num; // save record no. in the index ptr->link = new node; // get new node for next record ptr = ptr->link; infile.read((char*)&emp,sizeof(emp)); // read next record ptr->link = NULL; // end of list // sort record nos. ptr1 = start; // set pointer to start of the index while(ptr1->link!= NULL) ptr2 = ptr1->link; // set second pointer while( ptr2!= NULL) if(ptr2->rec_no < ptr1->rec_no) temp_recno = ptr2->rec_no; // exchange values ptr2->rec_no = ptr1->rec_no; ptr1->rec_no = temp_recno; ptr2 = ptr2->link; // next node ptr2 = ptr1->link; ptr1 = ptr2; // next pass // generate record no. ptr1 = start; while(ptr1!= NULL && found!= 1) ptr2 = ptr1; ptr1 = ptr1->link; if ((ptr2->rec_no)+1!= ptr1->rec_no) recno = (ptr2->rec_no)+1; found = 1; if (found!= 1) recno = (ptr2->rec_no)+1; // destroy the index ptr = start; while(start!= NULL ) start = start->link;

9 delete ptr; // delete index to save memory return recno; // return the calculated record no. // this function reads data void employee::get_data() clrscr(); employee_num = get_rec_no(); // aotomatic generation of empship no. cout<<"\n ENTER THE NAME > "; gets(employee_name); cout<<"\n ENTER THE ADDRESS >"; gets(employee_address); cout<<"\n ENTER THE DATE OF JOINING << dd/mm/yyyy >> -----> "; cin>>date_joining.dd>>ch>>date_joining.mm>>ch>>date_joining.yyyy; cout<<"\n ENTER THE DATE OF BIRTH << dd/mm/yyyy >> -----> "; cin>>date_birth.dd>>ch>>date_birth.mm>>ch>>date_birth.yyyy; cout<<"\n ENTER DESIGNATION > "; gets(desig_nation); cout<<"\n ENTER THE BASIC SALARY > "; cin>>basic_salary; // this function displays data void employee::show_data() clrscr(); cout<<"\n EMPLOYEE NO > "<<employee_num; cout<<"\n EMPLOYEE's NAME > "<<employee_name; cout<<"\n ADTE OF JOINING > "<<date_joining.dd <<"-"<<date_joining.mm <<"-"<<date_joining.yyyy; cout<<"\n EMPLOYEE's ADDRESS ----> "<<employee_address; cout<<"\n DATE OF BIRTH > "<<date_birth.dd <<"-"<<date_birth.mm <<"-"<<date_birth.yyyy; cout<<"\n DESIGNATION > "<<desig_nation; cout<<"\n BASIC SALARY > RS. "<<setw(15) // setwidth <<setprecision(2) // set position of decimal point <<setiosflags(ios::left) // set left justified output

10 <<setiosflags(ios::showpoint) // always show decimal point <<setiosflags(ios::fixed) // set fixed notation for display <<basic_salary; gotoxy(22,24); cout<<" PRESS ANY KEY TO CONTINUE"; getch(); // this function writes a record into a file void add_object() fstream outfile; char choice = 'y'; while(choice == 'y') clrscr(); // clear screen char ch; // update employee file outfile.open("employee.dat",ios::app); // open file inappend mode emp.get_data(); // get information from the user outfile.write((char*)&emp,sizeof(emp)); // write in the file outfile.flush(); outfile.close(); // close file //update monthly pay file pay.emp_num = emp.employee_num; strcpy(pay.emp_name,emp.employee_name); strcpy(pay.emp_designation,emp.desig_nation); outfile.open("payfile.dat",ios::app); // open fees file in append mode outfile.write((char*)&pay,sizeof(pay)); // make entry in fees file outfile.flush(); outfile.close(); // close fees file cout<<"\n ANY MORE RECORDS TO BE ENTERED << y/n >> > "; cin>>choice;

11 // this function displays the contents of file of emps void employee::show_object() fstream infile; infile.open("employee.dat",ios::in); // open file for reading infile.seekg(0,ios::beg); // set file pointer to the begining of the file infile.read((char*)&emp,sizeof(emp)); // read the first record while(!infile.eof() ) emp.show_data(); // display record infile.read((char*)&emp,sizeof(emp)); // read the next record // this function deletes the record of an employee void del_object() unsigned long code; fstream infile,outfile; cout<<"\n ENTER THE MEMBERSHIP NO. TO BE DELETED ----> "; cin>>code; // update emp file outfile.open("tempfile.dat",ios::app); // open temporary file infile.open("employee.dat",ios::in); // open employee file infile.seekg(0,ios::beg); // set file pointer to the begining of the file infile.read((char*)&emp,sizeof(emp)); // read the first record while(!infile.eof()) if(emp.employee_num!= code) // if this record is not to be deleted // write in temporary file outfile.write((char*)&emp,sizeof(emp)); infile.read((char*)&emp,sizeof(emp)); // read the next record infile.close(); // close employee file outfile.close(); // close temporary file remove("employee.dat"); // delete old employee file rename("tempfile.dat","employee.dat"); // temporary file becomes new employee file

12 // update pay file outfile.open("tempfile.dat",ios::app); // open temporary file infile.open("payfile.dat",ios::in); // open pay file for reading infile.seekg(0,ios::beg); // set file pointer to the begining of the file infile.read((char*)&pay,sizeof(pay)); // read the first record while(!infile.eof() ) if(pay.emp_num!= code) // if this record is not to be deleted // write it in the temporary outfile.write((char*)&pay,sizeof(pay)); infile.read((char*)&pay,sizeof(pay)); // read next record infile.close(); // close pay file outfile.close(); // close temporary file remove("payfile.dat"); // delete old monthly pay file rename("tempfile.dat","payfile.dat"); // temporary file becomes new pay file //this function modiies information regarding an employee void employee::modify_object() fstream file; int mod_choice; unsigned long code; do // display modify menu clrscr(); cout<<"\n MODIFY MENU "; cout<<"\n "; cout<<"\n CHANGE ADDRESS.. 1"; cout<<"\n CHANGE DESIGNATION.. 2 "; cout<<"\n CHANGE BASIC SALARY.. 3"; cout<<"\n EXIT MODIFY MENU.. 4"; cout<<"\n\n ENTER YOUR CHOICE NO > "; cin>>mod_choice; if (mod_choice!= 4) cout<<"\n ENTER THE EMPLOYEE NUMBERE --->"; cin>> code; file.open("employee.dat",ios::in ios::out); // open file for reading/writing file.seekg(0,ios::beg); // set file pointer to the begining of the file file.read((char*)&emp,sizeof(emp)); // read first record int n = file.tellg(); // tell where we are

13 while(!file.eof() ) if (code == emp.employee_num) // record found switch(mod_choice) case 1 : clrscr(); // get new information cout<<"\n ENTER THE NEW ADDRESS -->"; gets(emp.employee_address); file.seekg(n-sizeof(emp)); // set file pointer to the record to be modified file.write((char*)&emp,sizeof(emp)); // update record file.flush(); changed modified case 2 : clrscr(); // get new information cout<<"\n ENTER THE NEW DESIGNATION --->"; gets(desig_nation); file.seekg(n-sizeof(emp)); // set file pointer to the record to be file.write((char*)&emp,sizeof(emp)); // update record file.flush(); case 3 : clrscr(); // get new information cout<<"\n ENTER NEW BASIC SALARY ---->"; cin>>emp.basic_salary; file.seekg(n-sizeof(emp)); // set file pointer to the record to be file.write((char*)&emp,sizeof(emp)); file.flush(); // end switch // end if file.read((char*)&emp,sizeof(emp)); // read next record n = file.tellg(); // tell where we are // end while file.close(); // end if // end do while loop while( mod_choice!= 4);

14 clrscr(); // clear screen cout<<"\n YOU ENDED THE MODIFY SESSION" ; cout<<"\n THANK YOU! "; delay(700); // this function searches information on the basis of a given field void employee:: search_object() fstream infile; int search_choice; long int phno; unsigned long code; char name[25]; do int counter = 0; // initialize counter to zero clrscr(); // clear screen // display search menu cout<<"\n SEARCH MENU "; cout<<"\n "; cout<<"\n EMPLOYEE CODE..1 "; cout<<"\n EMPLOYEE NAME..2 "; cout<<"\n EXIT..3 "; cout<<"\n\n ENTER YOUR CHOICE NO >"; cin>>search_choice; switch(search_choice) case 1 : clrscr(); //clear ecreen cout<<"\n ENTER THE MEMBER CODE TO BE SEARCHED-->"; cin >>code; // get record no. infile.open("employee.dat",ios::in); // open file for reading infile.seekg(0,ios::beg); infile.read((char*)&emp,sizeof(emp)); // read first record while(!infile.eof()) if(emp.employee_num == code) // record found counter++; // increment counter // set file pointer to the begining of the file

15 emp.show_data(); // display record infile.read((char*)&emp,sizeof(emp)); // read next record infile.close(); // if end of file,close file gotoxy(22,24); cout<<" RECORDS FOUND = "<<counter; // display counter getch(); // wait for keypress case 2 : clrscr(); // clear screen cout<<"\n ENTER THE MEMBER NAME TO BE SEARCHED --> "; cin>>name; infile.open("employee.dat",ios::in); // open file for reading infile.seekg(0,ios::beg); // set file pointer to the begining of the file infile.read((char*)&emp,sizeof(emp)); // read first record while(!infile.eof()) if(strcmpi(emp.employee_name,name)==0) // record found counter++; // increment counter emp.show_data(); // display record infile.read((char*)&emp,sizeof(emp)); // read next record infile.close(); // close file gotoxy(22,24); cout<<" RECORDS FOUND = "<<counter; // display counter getch(); // wait for keypress case 3 : clrscr(); // clear screen gotoxy(22,15); // set position for display cout<<" YOU ENDED THE SEARCH SESSION "; gotoxy(27,18); cout<<" THANK YOU!"; delay(700); // wait for some time while(search_choice!= 3);

16 //this function generates reports void reports() fstream infile; int report_choice; do // display report menu clrscr(); // clear screen cout<<"\n REPORT MENU "; cout<<"\n "; cout<<"\n LIST OF ALL EMPLOYEES.. 1"; cout<<"\n SALARY STATEMENTS OF ALL EMPLOYEES.. 2"; cout<<"\n SALARY SLIP OF ALL EMPLOYEES.. 3"; cout<<"\n EXIT REPORTS SESSION.. 4"; cout<<"\n\n REPORT ON WHAT? < ENTER CHOICE NO. > > "; cin>>report_choice; switch(report_choice) case 1 : clrscr(); emp.show_object(); case 2 : clrscr(); cout<<"\n "; cout<<"\n ABC CORPORATION "; cout<<"\n "; cout<<"\n EMP.NO. EMP.NAME EARNINGS DEDUCTIONS "; cout<<"\n DESIG. BASIC DA PF OTHER DED. GROSS PAY"; cout<<"\n HRA CCA ITAX NET PAY"; cout<<"\n ONVEYANCE "; cout<<"\n \n"; file infile.open("payfile.dat",ios::in); infile.seekg(0,ios::beg); // open pay file for reading // set file pointer to the begining of the infile.read((char*)&pay,sizeof(pay)); // read the first record while(!infile.eof() )

17 cout<<" "; // leave some space cout<<setiosflags(ios::left) // set left justified output <<setw(9) // set width of the output <<pay.emp_num <<setw(14) // set width of the output <<pay.emp_name; cout<<setiosflags(ios::fixed) // set fixed notation output <<setiosflags(ios::showpoint) // always show decimal point <<setprecision(2) // set position of decimal point <<setw(12) // set width of the output <<pay.basic_pay <<setw(10) // set width of the output <<pay.da <<setw(10) // set width of the output <<pay.pf <<setw(10) // set width of the output <<pay.other_deductions <<setw(12) // set width of the output <<pay.gross_pay <<endl; // next line cout<<" "; // leave some space cout<<setiosflags(ios::left) // set left justified output <<setw(17) // set width of the output <<pay.emp_designation; cout<<setiosflags(ios::fixed) // set fixed notation output <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(12) // set width of the output <<pay.hra <<setw(10) // set width of the output <<pay.cca <<setw(20) // set width of the output <<pay.income_tax <<setw(12) // set width of the output <<pay.net_pay <<endl; // next line cout<<" "; // leave some space cout<<setiosflags(ios::fixed) // set fixed notation output <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(8) // set width of the output <<pay.con_veyance <<endl // next line <<endl; // next line

18 infile.read((char*)&pay,sizeof(pay)); // read next record infile.close(); // close pay file gotoxy(22,24); cout<<"press ANY KEY TO CONTINUE"; getch(); // wait for key press case 3 : clrscr(); char ch,month[9]; cout<<"\n ENTER CURRENT DATE << dd/mm/yyyy >> >"; cin>>current_date.dd>>ch >>current_date.mm>>ch >>current_date.yyyy; // get current date switch(current_date.mm) // get month name case 1 : strcpy( month, "JANUARY" ); case 2 : strcpy( month, "FEBRUARY" ); case 3 : strcpy( month, "MARCH" ); case 4 : strcpy( month, "APRIL" ); case 5 : strcpy( month, "MAY" ); case 6 : strcpy( month, "JUNE" ); case 7 : strcpy( month, "JULY" ); case 8 : strcpy( month, "AUGUST" ); case 9 : strcpy( month, "SEPTEMBER"); case 10 : strcpy( month, "OCTOBER" ); case 11 : strcpy( month, "NOVEMBER "); case 12 : strcpy( month, "DECEMBER" ); infile.open("payfile.dat",ios::in); // open pay file for reading infile.seekg(0,ios::beg); // set file pointer to the begining of the file infile.read((char*)&pay,sizeof(pay)); // read first record while(!infile.eof() ) clrscr(); // clear screen and display record cout<<"\n "; cout<<"\n ABC CORPORATION "; cout<<"\n SALARY SLIP FOR THE MONTH OF "<<month<<" - "<<current_date.yyyy; cout<<"\n "; cout<<"\n ENPLOYEE NO. : "<<setiosflags(ios::left) // set left justified output <<setw(10) // set width for display <<pay.emp_num ; cout<<" NAME : " ;

19 notation point point cout<<setiosflags(ios::left) <<setw(20) <<pay.emp_name; cout<<"\n\n EARNINGS DEDUCTIONS"; cout<<"\n "; cout<<"\n BASIC : RS. "<<setiosflags(ios::fixed) // display in fixed <<setiosflags(ios::showpoint) // always show <<setprecision(2) // set position of the decimal <<setw(12) // set width for display <<pay.basic_pay; cout<<" PF : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setiosflags(ios::showpoint) // always show point <<setprecision(2) // set position of decimal point <<setw(12) // set eidth of display <<pay.pf; cout<<"\n DA : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setiosflags(ios::showpoint) // always show decimal point <<setprecision(2) // set position of decimal point <<setw(12) // set width for dispaly <<pay.da; cout<<" ITAX : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setiosflags(ios::showpoint) // always show decimal point <<setprecision(2) // set position of decimal point <<setw(12) // set eidth of display <<pay.income_tax; cout<<"\n HRA : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setiosflags(ios::showpoint) // always show decimal point <<setprecision(2) // set position of decimal point <<setw(12) // set eidth of display <<pay.hra; cout<<" OTHER DEDUCTIONS : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setiosflags(ios::showpoint) // always show decimal point <<setprecision(2) // set position of decimal point <<setw(12) // set eidth of display <<pay.other_deductions; cout<<" CCA : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation

20 --"; --"; --"; <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(12) // set eidth of display <<pay.cca; cout<<"\n CONVEYANCE : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(12) // set eidth of display <<pay.con_veyance; cout<<"\n\n GROSS PAY : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(12) // set eidth of display <<pay.gross_pay; cout<<" TOTAL DEDUCTIONS : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(12) // set eidth of display <<pay.gross_pay-pay.net_pay; cout<<"\n NET PAY : RS. "; cout<<setiosflags(ios::fixed) // display in fixed notation <<setprecision(2) // set position of decimal point <<setiosflags(ios::showpoint) // always show decimal point <<setw(12) // set eidth of display <<pay.net_pay; cout<<"\n cout<<"\n SIGNATORY AUTHORITY "; cout<<"\n cout<<"\n gotoxy(22,24); cout<<"press ANY KEY TO CONTINUE"; getch(); // wait for key press infile.read((char*)&pay,sizeof(pay)); // read next record infile.close(); // close pay file case 4 : clrscr(); gotoxy(22,15); cout<<" YOU ENDE THE REPORT SESSION";

21 gotoxy(27,18); cout<<" THANK YOU!"; delay(700); // wait for some time while(report_choice!= 4); /* this function can be called in the main function if required to make the project colorfull */ void graphic_screen() int driver,mode; driver = DETECT; initgraph(&driver,&mode,""); // initialize graph setbkcolor(10); // set background color to light green setcolor(1); // set text color to blue settextstyle(4,0,8); // set text font,direction,text size outtextxy(150,25,"payroll"); // display text outtextxy(20,150,"management"); outtextxy(150,300,"system"); delay(5000); // wait for some time closegraph(); // close graph for next screen initgraph(&driver,&mode,""); setbkcolor(10); setcolor(1); settextstyle(0,0,9); outtextxy(100,100,"developed"); settextstyle(0,0,6); outtextxy(250,250,"by"); delay(5000); closegraph(); initgraph(&driver,&mode,""); setbkcolor(10); setcolor(1); settextstyle(0,0,5); outtextxy(60,100,"nitin BHATIA"); delay(5000); closegraph();

22 initgraph(&driver,&mode,""); setbkcolor(10); setcolor(1); settextstyle(0,0,5); outtextxy(60,100,"guided BY"); outtextxy(50,200,"mr. A.K.SHARMA"); delay(5000); closegraph(); // this is the main function void main() int main_choice; // graphic_screen(); /* the above mentioned graphic function can be called here if colorfull screen is required */ do // display main menu clrscr(); // clear screen gotoxy(22,7); cout<<" MAIN MENU "; gotoxy(22,8); cout<<" "; gotoxy(22,10); cout<<" REGISTER A NEW EMPLOYEE..1 "; gotoxy(22,11); cout<<" REMOVE AN EMPLOYEE..2 "; gotoxy(22,12); cout<<" MODIFY INFORMATION ABOUT AN EMPLOYEE..3 "; gotoxy(22,13); cout<<" SEARCH FOR INFORMATION ABOUT AN EMPLOYEE..4 "; gotoxy(22,14); cout<<" UPDATE MONTHLY PAY FILE..5 "; gotoxy(22,15); cout<<" REPORTS..6 "; gotoxy(22,16); cout<<" EXIT..7 "; gotoxy(25,20); cout<<" ENTER YOUR CHOICE NO. ----> "; cin>>main_choice; switch(main_choice)

23 case 1 : add_object(); // call function to register a new employee case 2 : del_object(); // call function to delete the record of an employee case 3 : emp.modify_object(); // this function can modify information case 4 : emp.search_object(); // this function searches information about an employee case 5 : pay.update_pay_file(); // this function generates monthly pay file case 6 : reports(); // this function generate reports case 7 : clrscr(); gotoxy(25,10); cout<<" YOU ENDED THE SESSION "; gotoxy(27,12); cout<<" THANK YOU! "; delay(1000); while(main_choice!= 7);

24 OUTPUT SCREEN

25

26

27

28

29

30

31

SUBMITTED AS A PART OF C.B.S.E. CURRICULUM FOR THE YEAR

SUBMITTED AS A PART OF C.B.S.E. CURRICULUM FOR THE YEAR SUBMITTED AS A PART OF C.B.S.E. CURRICULUM FOR THE YEAR 2008-09 CONTENTS CERTIFICATE ACKNOWLEDGEMENT PROJECT PREAMBLE PROJECT STUDY ALGORITHM SOURCE CODE OUTPUT CERTIFICATE This is to certify that, Roll

More information

C++ Programming Lecture 10 File Processing

C++ Programming Lecture 10 File Processing C++ Programming Lecture 10 File Processing By Ghada Al-Mashaqbeh The Hashemite University Computer Engineering Department Outline Introduction. The Data Hierarchy. Files and Streams. Creating a Sequential

More information

CSC 138 Structured Programming CHAPTER 4: TEXT FILE [PART 1]

CSC 138 Structured Programming CHAPTER 4: TEXT FILE [PART 1] CSC 138 Structured Programming CHAPTER 4: TEXT FILE [PART 1] LEARNING OBJECTIVES Upon completion, you should be able to: o define C++ text files o explain the benefits of using I/O file processing o explain

More information

Chapte t r r 9

Chapte t r r 9 Chapter 9 Session Objectives Stream Class Stream Class Hierarchy String I/O Character I/O Object I/O File Pointers and their manipulations Error handling in Files Command Line arguments OOPS WITH C++ Sahaj

More information

Object Oriented Programming Using C++ UNIT-3 I/O Streams

Object Oriented Programming Using C++ UNIT-3 I/O Streams File - The information / data stored under a specific name on a storage device, is called a file. Stream - It refers to a sequence of bytes. Text file - It is a file that stores information in ASCII characters.

More information

CS561 Manju Muralidharan Priya Structures in C CS200 STRUCTURES. Manju Muralidharan Priya

CS561 Manju Muralidharan Priya Structures in C CS200 STRUCTURES. Manju Muralidharan Priya OBJECTIVES: CS200 STRUCTURES Manju Muralidharan Priya By the end of this class you will have understood: 1. Definition of a structure 2. Nested Structures 3. Arrays of structure 4. User defined data types

More information

Come and join us at WebLyceum

Come and join us at WebLyceum Come and join us at WebLyceum For Past Papers, Quiz, Assignments, GDBs, Video Lectures etc Go to http://www.weblyceum.com and click Register In Case of any Problem Contact Administrators Rana Muhammad

More information

File I/O. File Names and Types. I/O Streams. Stream Extraction and Insertion. A file name should reflect its contents

File I/O. File Names and Types. I/O Streams. Stream Extraction and Insertion. A file name should reflect its contents File I/O 1 File Names and Types A file name should reflect its contents Payroll.dat Students.txt Grades.txt A file s extension indicates the kind of data the file holds.dat,.txt general program input or

More information

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer:

Chapter-11 POINTERS. Important 3 Marks. Introduction: Memory Utilization of Pointer: Pointer: Chapter-11 POINTERS Introduction: Pointers are a powerful concept in C++ and have the following advantages. i. It is possible to write efficient programs. ii. Memory is utilized properly. iii. Dynamically

More information

COMP322 - Introduction to C++

COMP322 - Introduction to C++ COMP322 - Introduction to C++ Winter 2011 Lecture 05 - I/O using the standard library & Introduction to Classes Milena Scaccia School of Computer Science McGill University February 1, 2011 Final note on

More information

ios ifstream fstream

ios ifstream fstream File handling in C++ In most of the real time programming problems we need to store the data permanently on some secondary storage device so that it can be used later. Whenever we have to store the data

More information

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms.

1. FIBONACCI SERIES. Write a C++ program to generate the Fibonacci for n terms. To write a C++ program to generate the Fibonacci for n terms. PROBLEM: 1. FIBONACCI SERIES Write a C++ program to generate the Fibonacci for n terms. AIM: To write a C++ program to generate the Fibonacci for n terms. PROGRAM CODING: #include #include

More information

Ch 6. Structures and Classes

Ch 6. Structures and Classes 2013-2 Ch 6. Structures and Classes September 1, 2013 Advanced Networking Technology Lab. (YU-ANTL) Dept. of Information & Comm. Eng, Graduate School, Yeungnam University, KOREA (Tel : +82-53-810-2497;

More information

A stream is infinite. File access methods. File I/O in C++ 4. File input/output David Keil CS II 2/03. The extractor and inserter form expressions

A stream is infinite. File access methods. File I/O in C++ 4. File input/output David Keil CS II 2/03. The extractor and inserter form expressions Topic: File input/output I. Streams II. Access methods III. C++ style Input, output, random access Stream classes: ifstream, ofstream IV. C style The FILE data type Opening files Writing to, reading text

More information

1 Pointer Concepts. 1.1 Pointer Examples

1 Pointer Concepts. 1.1 Pointer Examples 1 1 Pointer Concepts What are pointers? How are they used? Point to a memory location. Call by reference is based on pointers. Operators: & Address operator * Dereferencing operator Machine/compiler dependencies

More information

Subject: Fundamental of Computer Programming 2068

Subject: Fundamental of Computer Programming 2068 Subject: Fundamental of Computer Programming 2068 1 Write an algorithm and flowchart to determine whether a given integer is odd or even and explain it. Algorithm Step 1: Start Step 2: Read a Step 3: Find

More information

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team

Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Page. No. 1/15 CS201 Introduction to Programmming Solved Subjective Questions From spring 2010 Final Term Papers By vuzs Team Question No: 1 ( Marks: 2 ) Write a declaration statement for an array of 10

More information

After going through this lesson, you would be able to: store data in a file. access data record by record from the file. move pointer within the file

After going through this lesson, you would be able to: store data in a file. access data record by record from the file. move pointer within the file 16 Files 16.1 Introduction At times it is required to store data on hard disk or floppy disk in some application program. The data is stored in these devices using the concept of file. 16.2 Objectives

More information

CS 1044 Program 1 Fall 1998

CS 1044 Program 1 Fall 1998 Learning to Use the Development Environment Obviously you cannot program unless you understand how to create a file containing your C++ language source code, how to compile and link the source code to

More information

Engineering Problem Solving with C++, 3e Chapter 2 Test Bank

Engineering Problem Solving with C++, 3e Chapter 2 Test Bank 1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A. integer B 1.427E3 B. double D "Oct" C. character B -63.29 D. string F #Hashtag

More information

IV Unit Second Part STRUCTURES

IV Unit Second Part STRUCTURES STRUCTURES IV Unit Second Part Structure is a very useful derived data type supported in c that allows grouping one or more variables of different data types with a single name. The general syntax of structure

More information

Chapter-6 Classes and Objects. stud.execute(); getch();} Output:

Chapter-6 Classes and Objects. stud.execute(); getch();} Output: Chapter-6 Classes and Objects Examples: 1.Specifying a class: class student char name[30]; int rollno,mark1,mark2,total_marks; void accept() cout>name>>rollno>>mark1>>mark2;

More information

1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A.

1. Match each of the following data types with literal constants of that data type. A data type can be used more than once. A. Engineering Problem Solving With C++ 4th Edition Etter TEST BANK Full clear download (no error formating) at: https://testbankreal.com/download/engineering-problem-solving-with-c-4thedition-etter-test-bank/

More information

Convenient way to deal large quantities of data. Store data permanently (until file is deleted).

Convenient way to deal large quantities of data. Store data permanently (until file is deleted). FILE HANDLING Why to use Files: Convenient way to deal large quantities of data. Store data permanently (until file is deleted). Avoid typing data into program multiple times. Share data between programs.

More information

c++ keywords: ( all lowercase ) Note: cin and cout are NOT keywords.

c++ keywords: ( all lowercase ) Note: cin and cout are NOT keywords. Chapter 1 File Extensions: Source code (cpp), Object code (obj), and Executable code (exe). Preprocessor processes directives and produces modified source Compiler takes modified source and produces object

More information

COMPUTER SCIENCE (083)

COMPUTER SCIENCE (083) Roll No. Code : 112011-083-A Please check that this question paper contains 7 questions and 6 printed pages. CLASS-XI COMPUTER SCIENCE (083) Time Allowed : 3 Hrs. Maximum Marks : 70 General Instructions

More information

Consider the following statements. string str1 = "ABCDEFGHIJKLM"; string str2; After the statement str2 = str1.substr(1,4); executes, the value of str2 is " ". Given the function prototype: float test(int,

More information

Linked List using a Sentinel

Linked List using a Sentinel Linked List using a Sentinel Linked List.h / Linked List.h Using a sentinel for search Created by Enoch Hwang on 2/1/10. Copyright 2010 La Sierra University. All rights reserved. / #include

More information

Split up Syllabus (Session )

Split up Syllabus (Session ) Split up Syllabus (Session- -17) COMPUTER SCIENCE (083) CLASS XI Unit No. Unit Name Marks 1 COMPUTER FUNDAMENTALS 10 2 PROGRAMMING METHODOLOGY 12 3 INTRODUCTION TO C++ 14 4 PROGRAMMING IN C++ 34 Total

More information

File handling Basics. Lecture 7

File handling Basics. Lecture 7 File handling Basics Lecture 7 What is a File? A file is a collection of information, usually stored on a computer s disk. Information can be saved to files and then later reused. 2 File Names All files

More information

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE

CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE CAMBRIDGE SCHOOL, NOIDA ASSIGNMENT 1, TOPIC: C++ PROGRAMMING CLASS VIII, COMPUTER SCIENCE a) Mention any 4 characteristic of the object car. Ans name, colour, model number, engine state, power b) What

More information

AIR FORCE SCHOOL,BAMRAULI COMPUTER SCIENCE (083) CLASS XI Split up Syllabus (Session ) Contents

AIR FORCE SCHOOL,BAMRAULI COMPUTER SCIENCE (083) CLASS XI Split up Syllabus (Session ) Contents AIR FORCE SCHOOL,BAMRAULI COMPUTER SCIENCE (083) CLASS XI Split up Syllabus (Session- 2017-18) Month July Contents UNIT 1: COMPUTER FUNDAMENTALS Evolution of computers; Basics of computer and its operation;

More information

Time: 3 HOURS Maximum Marks: 100

Time: 3 HOURS Maximum Marks: 100 ANNA UNIVERSITY:CHENNAI 600 025 M.E/M.Tech. DEGREE EXAMINATIONS, NOV./DEC. 2014 Regulations 2013 Third Semester B.E. Computer Science and Engineering CS6311: PROGRAMMING AND DATA STRUCTURES LABORATORY

More information

Structured Data. CIS 15 : Spring 2007

Structured Data. CIS 15 : Spring 2007 Structured Data CIS 15 : Spring 2007 Functionalia HW4 Part A due this SUNDAY April 1st: 11:59pm Reminder: I do NOT accept LATE HOMEWORK. Today: Dynamic Memory Allocation Allocating Arrays Returning Pointers

More information

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++

I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination. June, 2015 BCS-031 : PROGRAMMING IN C ++ No. of Printed Pages : 3 I BCS-031 BACHELOR OF COMPUTER APPLICATIONS (BCA) (Revised) Term-End Examination 05723. June, 2015 BCS-031 : PROGRAMMING IN C ++ Time : 3 hours Maximum Marks : 100 (Weightage 75%)

More information

Ch 6-1. Structures. March 30, Prof. Young-Tak Kim

Ch 6-1. Structures. March 30, Prof. Young-Tak Kim 2014-1 Ch 6-1. Structures March 30, 2014 Advanced Networking Technology Lab. (YU-ANTL) Dept. of Information & Comm. Eng, Graduate School, Yeungnam University, KOREA (Tel : +82-53-810-2497; Fax : +82-53-810-4742

More information

Chapter-14 STRUCTURES

Chapter-14 STRUCTURES Chapter-14 STRUCTURES Introduction: We have seen variables of simple data types, such as float, char, and int. Variables of such types represent one item of information: a height, an amount, a count, and

More information

(a) Differentiate between a call by value and call by reference method.

(a) Differentiate between a call by value and call by reference method. ATOMIC ENERGY CENTRAL SCHOOL NO- RAWATBHATA Half Yearly Examination 05 Model Paper Class XII Subject Computer Science Time Allowed: hours Maximum Marks: 70 Note. (i) All questions are compulsory. (ii)

More information

a) (5 points) What is the output of the following code sequence? int *ptr = 0x1050; printf ("%x\n", ptr--); printf ("%x\n", ptr);

a) (5 points) What is the output of the following code sequence? int *ptr = 0x1050; printf (%x\n, ptr--); printf (%x\n, ptr); Problem 1: Short Answers (25 points) a) (5 points) What is the output of the following code sequence? int *ptr = 0x1050; printf ("%x\n", ptr--); printf ("%x\n", ptr); b) (5 points) What are the three basic

More information

Chapter 15 - C++ As A "Better C"

Chapter 15 - C++ As A Better C Chapter 15 - C++ As A "Better C" Outline 15.1 Introduction 15.2 C++ 15.3 A Simple Program: Adding Two Integers 15.4 C++ Standard Library 15.5 Header Files 15.6 Inline Functions 15.7 References and Reference

More information

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Ch - 7. Data File Handling

Kapil Sehgal PGT Computer. Science Ankleshwar Gujarat Ch - 7. Data File Handling Introduction Data File Handling The fstream.h Header file Data Files Opening and Closing File Steps to process a File in your Program Changing the behavior of Stream Sequential I/O With Files Detecting

More information

Review Questions II KEY

Review Questions II KEY CS 102 / ECE 206 Spring 2011 Review Questions II KEY The following review questions are similar to the kinds of questions you will be expected to answer on Exam II (April 7), which will focus on LCR, chs.

More information

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013

AC55/AT55 OBJECT ORIENTED PROGRAMMING WITH C++ DEC 2013 Q.2 a. Discuss the fundamental features of the object oriented programming. The fundamentals features of the OOPs are the following: (i) Encapsulation: It is a mechanism that associates the code and data

More information

COMP322 - Introduction to C++

COMP322 - Introduction to C++ COMP322 - Introduction to C++ Lecture 05 - I/O using the standard library, stl containers, stl algorithms Dan Pomerantz School of Computer Science 5 February 2013 Basic I/O in C++ Recall that in C, we

More information

Pointers. Addresses in Memory. Exam 1 on July 18, :00-11:40am

Pointers. Addresses in Memory. Exam 1 on July 18, :00-11:40am Exam 1 on July 18, 2005 10:00-11:40am Pointers Addresses in Memory When a variable is declared, enough memory to hold a value of that type is allocated for it at an unused memory location. This is the

More information

Objects and streams and files CS427: Elements of Software Engineering

Objects and streams and files CS427: Elements of Software Engineering Objects and streams and files CS427: Elements of Software Engineering Lecture 6.2 (C++) 10am, 13 Feb 2012 CS427 Objects and streams and files 1/18 Today s topics 1 Recall...... Dynamic Memory Allocation...

More information

DISK FILE PROGRAM. ios. ofstream

DISK FILE PROGRAM. ios. ofstream [1] DEFINITION OF FILE A file is a bunch of bytes stored on some storage media like magnetic disk, optical disk or solid state media like pen-drive. In C++ a file, at its lowest level is interpreted simply

More information

Dictionaries. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift Jaipur Region. Based on CBSE Curriculum Class -11. Neha Tyagi, KV 5 Jaipur II Shift

Dictionaries. By- Neha Tyagi PGT CS KV 5 Jaipur II Shift Jaipur Region. Based on CBSE Curriculum Class -11. Neha Tyagi, KV 5 Jaipur II Shift Dictionaries Based on CBSE Curriculum Class -11 By- Neha Tyagi PGT CS KV 5 Jaipur II Shift Jaipur Region Introduction Python provides us various options to store multiple values under one variable name.

More information

Week 3: File I/O and Formatting 3.7 Formatting Output

Week 3: File I/O and Formatting 3.7 Formatting Output Week 3: File I/O and Formatting 3.7 Formatting Output Formatting: the way a value is printed: Gaddis: 3.7, 3.8, 5.11 CS 1428 Fall 2014 Jill Seaman spacing decimal points, fractional values, number of digits

More information

Strings and Streams. Professor Hugh C. Lauer CS-2303, System Programming Concepts

Strings and Streams. Professor Hugh C. Lauer CS-2303, System Programming Concepts Strings and Streams Professor Hugh C. Lauer CS-2303, System Programming Concepts (Slides include materials from The C Programming Language, 2 nd edition, by Kernighan and Ritchie, Absolute C++, by Walter

More information

Unit-V File operations

Unit-V File operations Unit-V File operations What is stream? C++ IO are based on streams, which are sequence of bytes flowing in and out of the programs. A C++ stream is a flow of data into or out of a program, such as the

More information

Review Questions for Final Exam

Review Questions for Final Exam CS 102 / ECE 206 Spring 11 Review Questions for Final Exam The following review questions are similar to the kinds of questions you will be expected to answer on the Final Exam, which will cover LCR, chs.

More information

Programming Fundamentals. With C++ Variable Declaration, Evaluation and Assignment 1

Programming Fundamentals. With C++ Variable Declaration, Evaluation and Assignment 1 300580 Programming Fundamentals 3 With C++ Variable Declaration, Evaluation and Assignment 1 Today s Topics Variable declaration Assignment to variables Typecasting Counting Mathematical functions Keyboard

More information

Linear Data Structure

Linear Data Structure Linear Data Structure Definition A data structure is said to be linear if its elements form a sequence or a linear list. Examples: Array Linked List Stacks Queues Operations on linear Data Structures Traversal

More information

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions.

I BSc(IT) [ Batch] Semester II Core: Object Oriented Programming With C plus plus - 212A Multiple Choice Questions. Dr.G.R.Damodaran College of Science (Autonomous, affiliated to the Bharathiar University, recognized by the UGC)Reaccredited at the 'A' Grade Level by the NAAC and ISO 9001:2008 Certified CRISL rated 'A'

More information

Fundamentals of Programming Session 25

Fundamentals of Programming Session 25 Fundamentals of Programming Session 25 Instructor: Reza Entezari-Maleki Email: entezari@ce.sharif.edu 1 Fall 2013 These slides have been created using Deitel s slides Sharif University of Technology Outlines

More information

Exam I Review Questions Fall 2010

Exam I Review Questions Fall 2010 Exam I Review Questions Fall 2010 The following review questions are similar to the kinds of questions you will be expected to answer on Exam I (scheduled for Oct. 14), which will cover LCR, chs. 1 7,

More information

CS2141 Software Development using C/C++ Stream I/O

CS2141 Software Development using C/C++ Stream I/O CS2141 Software Development using C/C++ Stream I/O iostream Two libraries can be used for input and output: stdio and iostream The iostream library is newer and better: It is object oriented It can make

More information

Ch 6-2. File Input / Output

Ch 6-2. File Input / Output 2014-1 Ch 6-2. File Input / Output March 30, 2014 Advanced Networking Technology Lab. (YU-ANTL) Dept. of Information & Comm. Eng, Graduate School, Yeungnam University, KOREA (Tel : +82-53-810-2497; Fax

More information

Consider the following example where a base class has been derived by other two classes:

Consider the following example where a base class has been derived by other two classes: Class : BCA 3rd Semester Course Code: BCA-S3-03 Course Title: Object Oriented Programming Concepts in C++ Unit IV Polymorphism The word polymorphism means having many forms. Typically, polymorphism occurs

More information

Do not turn to the next page until the start of the exam.

Do not turn to the next page until the start of the exam. Introduction to Programming, PIC10A E. Ryu Fall 2017 Midterm Exam Friday, November 3, 2017 50 minutes, 11 questions, 100 points, 8 pages While we don t expect you will need more space than provided, you

More information

Example. Section: PS 709 Examples of Calculations of Reduced Hours of Work Last Revised: February 2017 Last Reviewed: February 2017 Next Review:

Example. Section: PS 709 Examples of Calculations of Reduced Hours of Work Last Revised: February 2017 Last Reviewed: February 2017 Next Review: Following are three examples of calculations for MCP employees (undefined hours of work) and three examples for MCP office employees. Examples use the data from the table below. For your calculations use

More information

Arrays and Pointers (part 2) Be extra careful with pointers!

Arrays and Pointers (part 2) Be extra careful with pointers! Arrays and Pointers (part 2) EECS 2031 22 October 2017 1 Be extra careful with pointers! Common errors: l Overruns and underruns Occurs when you reference a memory beyond what you allocated. l Uninitialized

More information

Arrays and Pointers (part 2) Be extra careful with pointers!

Arrays and Pointers (part 2) Be extra careful with pointers! Arrays and Pointers (part 2) CSE 2031 Fall 2011 23 October 2011 1 Be extra careful with pointers! Common errors: Overruns and underruns Occurs when you reference a memory beyond what you allocated. Uninitialized

More information

AAA //Members of AAA }; class BBB: public AAA //intermediate class. BBB { //Members of BBB };

AAA //Members of AAA }; class BBB: public AAA //intermediate class. BBB { //Members of BBB }; 1. a) Explain the following concepts with example: i) Data Hiding ii) Polymorphism [3] Data Hiding: Keeping the data in private or protected area of a class to prevent it from accidental modification (change)

More information

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010

Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of. MCA III SEM Session -2010 Rani Durgavati Vishwavidyalaya Jabalpur (M.P.) (UICSA) Master of Computer Application (MCA) Practical List of MCA III SEM Session -2010 MCA-301 - Object Oriented Programming in C++ 1. WAP to generate Fibonacci

More information

SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE. Sample paper-i. Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.:

SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE. Sample paper-i. Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.: SAMPLE PAPER-2015 CLASS-XII COMPUTER SCIENCE Sample paper-i Time allowed: 3 hours Maximum Marks: 70 Name : Roll No.: General Instruction 1. Please check that this question paper contains 7 questions. 2.

More information

COMPUTER SCIENCE PRACTICAL GUIDE [ ENGLISH MEDIUM ]

COMPUTER SCIENCE PRACTICAL GUIDE [ ENGLISH MEDIUM ] +2 COMPUTER SCIENCE PRACTICAL GUIDE 2018-19 [ ENGLISH MEDIUM ] NAME : SUBJECT: SCHOOL : Sastra Matriculation Higher Secondary School 1 Kilpennathur, Tiruvannamalai INSTRUCTIONS FOR THE CONDUCT OF PRACTICAL

More information

Name. CPTR246 Spring '17 (100 total points) Exam 2

Name. CPTR246 Spring '17 (100 total points) Exam 2 Name CPTR246 Spring '17 (100 total points) Exam 2 1. Pointer parameters (the old C way) In the following program, make all of the changes to convert the call-by-reference parameters in the function computeoptions

More information

Other Loop Options EXAMPLE

Other Loop Options EXAMPLE C++ 14 By EXAMPLE Other Loop Options Now that you have mastered the looping constructs, you should learn some loop-related statements. This chapter teaches the concepts of timing loops, which enable you

More information

Downloaded S. from Kiran, PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from

Downloaded S. from Kiran,  PGT (CS) KV, Malleswaram STRUCTURES. Downloaded from Downloaded S. from Kiran, www.studiestoday.com PGT (CS) KV, STRUCTURES WHAT IS A STRUCTURE? Structure is a collection of logically related data. It is also a collection of dissimilar datatype. Downloaded

More information

Object Oriented Pragramming (22316)

Object Oriented Pragramming (22316) Chapter 1 Principles of Object Oriented Programming (14 Marks) Q1. Give Characteristics of object oriented programming? Or Give features of object oriented programming? Ans: 1. Emphasis (focus) is on data

More information

C++ Quick Guide. Advertisements

C++ Quick Guide. Advertisements C++ Quick Guide Advertisements Previous Page Next Page C++ is a statically typed, compiled, general purpose, case sensitive, free form programming language that supports procedural, object oriented, and

More information

IS 0020 Program Design and Software Tools

IS 0020 Program Design and Software Tools 1 IS 0020 Program Design and Software Tools Stack/Queue - File Processing Lecture 10 March 29, 2005 Introduction 2 Storage of data Arrays, variables are temporary Files are permanent Magnetic disk, optical

More information

10/23/02 21:20:33 IO_Examples

10/23/02 21:20:33 IO_Examples 1 Oct 22 22:07 2000 extractor1.c Page 1 istream &operator>>( istream &in, Point &p ){ char junk; in >> junk >> p.x >> junk >> p.y >> junk; return in; 2 Oct 22 22:07 2000 extractor2.c Page 1 istream &operator>>(

More information

CIS 190: C/C++ Programming. Classes in C++

CIS 190: C/C++ Programming. Classes in C++ CIS 190: C/C++ Programming Classes in C++ Outline Header Protection Functions in C++ Procedural Programming vs OOP Classes Access Constructors Headers in C++ done same way as in C including user.h files:

More information

CHAPTER 3 Expressions, Functions, Output

CHAPTER 3 Expressions, Functions, Output CHAPTER 3 Expressions, Functions, Output More Data Types: Integral Number Types short, long, int (all represent integer values with no fractional part). Computer Representation of integer numbers - Number

More information

SPRINGBOARD UNIT 6 DATA ANALYSIS AND PROBABILITY

SPRINGBOARD UNIT 6 DATA ANALYSIS AND PROBABILITY SPRINGBOARD UNIT 6 DATA ANALYSIS AND PROBABILITY 6. Theoretical and Experimental Probability Probability = number of ways to get outcome number of possible outcomes Theoretical Probability the probability

More information

typedef int Array[10]; String name; Array ages;

typedef int Array[10]; String name; Array ages; Morteza Noferesti The C language provides a facility called typedef for creating synonyms for previously defined data type names. For example, the declaration: typedef int Length; Length a, b, len ; Length

More information

COMMON QUARTERLY EXAMINATION SEPTEMBER 2018

COMMON QUARTERLY EXAMINATION SEPTEMBER 2018 i.ne COMMON QUARTERLY EXAMINATION SEPTEMBER 2018 1. a) 12 2. a) Delete 3. b) Insert column 4. d) Ruler 5. a) F2 6. b) Auto fill 7. c) Label 8. c) Master page 9. b) Navigator 10. d) Abstraction 11. d) Void

More information

Solution: A pointer is a variable that holds the address of another object (data item) rather than a value.

Solution: A pointer is a variable that holds the address of another object (data item) rather than a value. 1. What is a pointer? A pointer is a variable that holds the address of another object (data item) rather than a value. 2. What is base address? The address of the nth element can be represented as (a+n-1)

More information

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C

Scheme G. Sample Test Paper-I. Course Name : Computer Engineering Group Course Code : CO/CD/CM/CW/IF Semester : Second Subject Tile : Programming in C Sample Test Paper-I Marks : 25 Time:1 Hrs. Q1. Attempt any THREE 09 Marks a) State four relational operators with meaning. b) State the use of break statement. c) What is constant? Give any two examples.

More information

KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION FOR CLASS XII SUBJECT: COMPUTER SCIENCE

KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION FOR CLASS XII SUBJECT: COMPUTER SCIENCE KENDRIYA VIDYALAYA SANGATHAN BHUBANESWAR REGION SECOND PREBOARD EXAMINATION 2014-15 FOR CLASS XII SUBJECT: COMPUTER SCIENCE SET-I F.M. 70 General Instructions: Programming Language C++ All Questions are

More information

Software Design & Programming I

Software Design & Programming I Software Design & Programming I Starting Out with C++ (From Control Structures through Objects) 7th Edition Written by: Tony Gaddis Pearson - Addison Wesley ISBN: 13-978-0-132-57625-3 Chapter 3 Introduction

More information

Programming Logic and Design Sixth Edition

Programming Logic and Design Sixth Edition Objectives Programming Logic and Design Sixth Edition Chapter 6 Arrays In this chapter, you will learn about: Arrays and how they occupy computer memory Manipulating an array to replace nested decisions

More information

Tutorial 8 (Array I)

Tutorial 8 (Array I) Tutorial 8 (Array I) 1. Indicate true or false for the following statements. a. Every element in an array has the same type. b. The array size is fixed after it is created. c. The array size used to declare

More information

Input and Output File (Files and Stream )

Input and Output File (Files and Stream ) Input and Output File (Files and Stream ) BITE 1513 Computer Game Programming Week 14 Scope Describe the fundamentals of input & output files. Use data files for input & output purposes. Files Normally,

More information

C Concepts - I/O. Lecture 19 COP 3014 Fall November 29, 2017

C Concepts - I/O. Lecture 19 COP 3014 Fall November 29, 2017 C Concepts - I/O Lecture 19 COP 3014 Fall 2017 November 29, 2017 C vs. C++: Some important differences C has been around since around 1970 (or before) C++ was based on the C language While C is not actually

More information

Honors Computer Science C++ Mr. Clausen Program 6A, 6B, 6C, & 6G

Honors Computer Science C++ Mr. Clausen Program 6A, 6B, 6C, & 6G Honors Computer Science C++ Mr. Clausen Program 6A, 6B, 6C, & 6G Special Note: Every program from Chapter 4 to the end of the year needs to have functions! Program 6A: Celsius To Fahrenheit Or Visa Versa

More information

Input and Output. Data Processing Course, I. Hrivnacova, IPN Orsay

Input and Output. Data Processing Course, I. Hrivnacova, IPN Orsay Input and Output Data Processing Course, I. Hrivnacova, IPN Orsay Output to the Screen Input from the Keyboard IO Headers Output to a File Input from a File Formatting I. Hrivnacova @ Data Processing Course

More information

Introduction. Structures, Unions, Bit Manipulations, and Enumerations. Structure. Structure Definitions

Introduction. Structures, Unions, Bit Manipulations, and Enumerations. Structure. Structure Definitions Introduction Structures, Unions, Bit Manipulations, and Enumerations In C, we can create our own data types If programmers do a good job of this, the end user does not even have to know what is in the

More information

PCGENESIS PAYROLL SYSTEM OPERATIONS GUIDE

PCGENESIS PAYROLL SYSTEM OPERATIONS GUIDE PCGENESIS PAYROLL SYSTEM OPERATIONS GUIDE 10/11/2011 Section I: Special Functions [Topic 8D: Payroll Earnings History File Processing, V1.3] Revision History Date Version Description Author 10/11/2011

More information

Pointers, Dynamic Data, and Reference Types

Pointers, Dynamic Data, and Reference Types Pointers, Dynamic Data, and Reference Types Review on Pointers Reference Variables Dynamic Memory Allocation The new operator The delete operator Dynamic Memory Allocation for Arrays 1 C++ Data Types simple

More information

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol.

1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. 1- Write a single C++ statement that: A. Calculates the sum of the two integrates 11 and 12 and outputs the sum to the consol. B. Outputs to the console a floating point number f1 in scientific format

More information

CSc Introduc/on to Compu/ng. Lecture 19 Edgardo Molina Fall 2011 City College of New York

CSc Introduc/on to Compu/ng. Lecture 19 Edgardo Molina Fall 2011 City College of New York CSc 10200 Introduc/on to Compu/ng Lecture 19 Edgardo Molina Fall 2011 City College of New York 18 Standard Device Files Logical file object: Stream that connects a file of logically related data to a program

More information

Lab 15 Review of Arrays, Array of Objects and Vector Dr. John Abraham, Professor

Lab 15 Review of Arrays, Array of Objects and Vector Dr. John Abraham, Professor Lab 15 Review of Arrays, Array of Objects and Vector Dr. John Abraham, Professor I have noticed over the years that students have great deal of difficulty dealing with composite and abstract data types.

More information

Arrays, Strings, & Pointers

Arrays, Strings, & Pointers Arrays, Strings, & Pointers Alexander Nelson August 31, 2018 University of Arkansas - Department of Computer Science and Computer Engineering Arrays, Strings, & Pointers Arrays, Strings, & Pointers are

More information

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of MCA

PESIT Bangalore South Campus Hosur road, 1km before Electronic City, Bengaluru -100 Department of MCA INTERNAL ASSESSMENT Scheme and Solution -T2 Date : 30/3/2015 Max Marks : 50 Subject & Code : Object Oriented Programming with C++(13MCA22 ) Name of faculty : R.Jayanthi Time : 11.30 am -1.00 Pm Answer

More information

Tutorial 13 Salary Survey Application: Introducing One- Dimensional Arrays

Tutorial 13 Salary Survey Application: Introducing One- Dimensional Arrays Tutorial 13 Salary Survey Application: Introducing One- Dimensional Arrays Outline 13.1 Test-Driving the Salary Survey Application 13.2 Introducing Arrays 13.3 Declaring and Initializing Arrays 13.4 Constructing

More information

cout << "How many numbers would you like to type? "; cin >> memsize; p = new int[memsize];

cout << How many numbers would you like to type? ; cin >> memsize; p = new int[memsize]; 1 C++ Dynamic Allocation Memory needs were determined before program execution by defining the variables needed. Sometime memory needs of a program can only be determined during runtime, or the memory

More information