can somebody help me?Im a 1st yr. college student taking up IT. And we have this case study that I cant seem to answer on my own so I decided to join daniweb. The program that Im referring to is a slum book simulating program.
Where you need to enter first a certain username and password before you can enter the whole of the program.
And you also need to integrate a menu that serves as the selection of the user on what task he wants to do. The menu must contain: ADD-To add data into the slumbook, DELETE-To delete the data that you have inputted. EDIT-To edit the data that has been inputted, SEARCH-To search a certain data entered into the program. LIST-the program will list all the data you have inputted. and EXIT to exit the program.
Here is the sample program that I have made, but still it has many errors when you try to run the program:

void main(){
char name[15][20],neym[15][20],ad[15][30],adr[15][20];
char hobiz[15][15],hobez[15][20],dis[15][30],ayaw[15][20];
char aget[15][4],age[15][4],usrnem[4],pasw[4];
char wern,nrew;
int choiz;index://index-keeps track of insertion;
int index=0;
cout<<"This is a slumbook simulating program";
cout<<"\nInput username to enter the program:";
cout<<"\nInput password:";cin>>pasw;
strcpy(usrnem, "wern");

cout<<"\n1.ADD DATA:";
cout<<"\n2.EDit DATA:";
cout<<"\n3.DELETE DATA:";
cout<<"\n4.LIST DATA:";
cout<<"\n5.SEARCH DATA:";
cout<<"\nEXIT THE PROGRAM:";
cout<<"\ninput your choice:";cin>>choiz;
if(choiz==1){cout<<"\nThis Function lets you add data into the slumbook:";

cout<<"\ninserting at index"<<index;
cout<<"\nInput name:";gets(name[index]);
cout<<"\nInput address:";gets(adr[index]);
cout<<"\nInput hobbies:";gets(hobez[index]);
cout<<"\nInput dislikes:";gets(ayaw[index]);
cout<<"\nInput age:";cin>>age[index];index++;

if(choiz==2){cout<<"\nThis Function lets you Edit Data in this slumbook:";     }

cout<<"\nInput hte name of the data to be eddited:";gets(name[index]);cout<<"\nName:"<<"      ";
cout<<"\nAddress:"<<"       ";gets(ad[index]);
cout<<"\nHobbies"<<"               ";gets(hobiz[index]);
cout<<"\nDislikes:"<<"               ";gets(dis[index]);
cout<<"\nAge:"<<"                ";gets(age[index]);
if(choiz==3){cout<<"\nThis Function lets you delete data in this sbook:";}
if(choiz==4){cout<<"\nThis function lets you view the list of the inputted data";}
cout<<"\nlisting all records:";
for(int a=0;a<=14;a++){
if(choiz==5){cout<<"\nThis function lets you search the data inputted:";
for(int f=0;f<=14;f++){cout<<"\n"<<neym[f];cout<<"\n";adr[f];cout<<"\n"<<hobez[f];
cout<<"\n";ayaw[f];cout<<"\n"<<age[f];} }
if(choiz==6){cout<<"\nYou have exitted the program:";}

pls help,

8 Years
Discussion Span
Last Post by bhoot_jb

You first need to learn how to format your code -- what you posted is a huge mess which I refuse to even try to read.

delete use of conio.h and studio.h -- this is a c++ program, not C.


Well You take in the data from the user and then again change it back....... With the strcopy(arg1,arg2) Function in main .


what ancient dragon said is correct. Your code isnt formatted at all. First of all, you need to learn that.

I would like to point out certain things though.

First of all, you need to decide which language you actually want to use - C or C++. It seems that you have included the iostream.h (a C++ header) file just to use 'cin' and 'cout'.

Also, i would like to point out the use of 'void main()' - The experts here had had warned me against using it. I am doing the same to you for just reasons. :)

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.