editing datas using function code in c++

editing datas using function code in c++

Page 1 of 1

2 Replies - 1704 Views - Last Post: 27 August 2008 - 05:23 AM Rate Topic: -----

#1 xyz_   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 27-August 08

editing datas using function code in c++

Posted 27 August 2008 - 04:46 AM

for example you have a data like this:

ID#: 21130
NAme: jack sparrow
SSS#: 213213
Pagibig#: 212122
Tin#: 321231
Civil status: S
Highest attainment: MBA
Position: Bookkeeper
Employment status: Permanent
Division: Marketing
Years in service: 3
Gross income: P 20000

and you want to edit only some parts of the data:
so it goes like this:
Empty datas mean to retain its original value.

ID# 20000
name:
SSS#:
Pagibig#:
Tin#:
Civil status: M
Highest attainment:
Position: MAnager
Employment Status:
Division:
Years in service: 5
Gross Income: P100,000

please send your code on my email address.... [email protected]

Is This A Good Question/Topic? 0
  • +

Replies To: editing datas using function code in c++

#2 NickDMax   User is offline

  • Can grep dead trees!
  • member icon

Reputation: 2255
  • View blog
  • Posts: 9,245
  • Joined: 18-February 07

Re: editing datas using function code in c++

Posted 27 August 2008 - 04:53 AM

[rules][/rules]
Was This Post Helpful? 0
  • +
  • -

#3 xyz_   User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 5
  • Joined: 27-August 08

Re: editing datas using function code in c++

Posted 27 August 2008 - 05:23 AM

alright here is my initial code

#include<iostream.h>
#include<conio.h>
#include<stdio.h>
#include<stdlib.h>

struct data
{
float id;
float sss,pagibig,tin,years;
double gross;
char name[20],civil[3],high_attain[10],position[20],employment[20],division[20];
}x[50];

int counter=0;

void input()
{
gotoxy(5,1);cout<<"\n";
gotoxy(25,2);cout<<"PERSONNEL RECORD MANAGEMENT";
gotoxy(5,3);cout<<"\n";
gotoxy(5,4);cout<<"1.Add New Record";
gotoxy(5,5);cout<<"2.Edit Record";
gotoxy(5,6);cout<<"3.Delete Record";
gotoxy(5,7);cout<<"4.Search Record";
gotoxy(5,8);cout<<"5.Show All Record";
gotoxy(5,9);cout<<"6.List of Permanent Employees";
gotoxy(5,10);cout<<"7.List of Probationary Employees";
gotoxy(5,11);cout<<"8.List of Employees with Gross Income less than P15,000.00";
gotoxy(5,12);cout<<"9.List of Employees with more than 5 years in service";
gotoxy(5,13);cout<<"10.Exit Application";
}

void add()
{
if(counter<50)
{
kawet:
gotoxy(3,1);cout<<"\n";
gotoxy(33,2);cout<<"ADD NEW RECORD";
gotoxy(3,3);cout<<"\n";
gotoxy(3,4);cout<<"ID#:\t\t\t";
cin>>(x[counter].id);
if((x[counter].id<10000)||(x[counter].id>100000))
{
clrscr();
goto kawet;
}
gotoxy(3,5);cout<<"Name:\t\t\t";
gets(x[counter].name);
gotoxy(3,6);cout<<"SSS#:\t\t\t";
cin>>(x[counter].sss);
gotoxy(3,7);cout<<"PAG-IBIG#:\t\t";
cin>>(x[counter].pagibig);
gotoxy(3,8);cout<<"TIN#:\t\t\t";
cin>>(x[counter].tin);
gotoxy(3,9);cout<<"Civil Status:\t\t";
gets(x[counter].civil);
gotoxy(3,10);cout<<"Highest Attainment:\t";
gets(x[counter].high_attain);
gotoxy(3,11);cout<<"Position:\t\t";
gets(x[counter].position);
gotoxy(3,12);cout<<"Employment Status:\t";
gets(x[counter].employment);
gotoxy(3,13);cout<<"Division:\t\t";
gets(x[counter].division);
gotoxy(3,14);cout<<"Years in Service:\t";
cin>>x[counter].years;
gotoxy(3,15);cout<<"Gross income:\t\tP";
cin>>x[counter].gross;
gotoxy(3,16);cout<<"\n";
gotoxy(3,17);cout<<"Record Successfully Stored!";
}
}

void edit()
{
gotoxy(3,1);cout<<"\n";
gotoxy(32,2);cout<<"EDIT RECORD";
gotoxy(3,3);cout<<"\n";

}

void delete_()
{
gotoxy(3,1);cout<<"\n";
gotoxy(33,2);cout<<"DELETE RECORD";
gotoxy(3,3);cout<<"\n";
}

void search()
{
gotoxy(3,1);cout<<"\n";
gotoxy(32,2);cout<<"SEARCH RECORD";
gotoxy(3,3);cout<<"\n";
}

void show()
{
gotoxy(3,1);cout<<"\n";
gotoxy(30,2);cout<<"SHOW ALL RECORDS";
gotoxy(3,3);cout<<"\n";
}


void main()
{
int zar;
char vis;

tae:
input();
cout<<"\n\n  Choice:";
cin>>zar;
switch(zar)
{
case 1:
clrscr();
add();
cout<<"\n\nAnother transaction(y/n)?";
cin>>vis;
if((vis=='y')||(vis=='Y'))
{
clrscr();
goto tae;
}
else
{
_exit(0);
}
break;

case 2:
clrscr();
edit();
cout<<"\nAnother transaction(y/n)?";
cin>>vis;
if((vis=='y')||(vis=='Y'))
{
clrscr();
goto tae;
}
else
{
_exit(0);
}
break;

case 3:
clrscr();
delete_();
cout<<"\nAnother transaction(y/n)?";
cin>>vis;
if((vis=='y')||(vis=='Y'))
{
clrscr();
goto tae;
}
else
{
_exit(0);
}
break;

case 4:
clrscr();
search();
cout<<"\nAnother transaction(y/n)?";
cin>>vis;
if((vis=='y')||(vis=='Y'))
{
clrscr();
goto tae;
}
else
{
_exit(0);
}
break;

case 5:
clrscr();
show();
cout<<"\nAnother transaction(y/n)?";
cin>>vis;
if((vis=='y')||(vis=='Y'))
{
clrscr();
goto tae;
}
else
{
_exit(0);
}
break;
}
}


Was This Post Helpful? 0
  • +
  • -

Page 1 of 1