| | |
pls. help in my program
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Oct 2008
Posts: 1
Reputation:
Solved Threads: 0
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:
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:
C++ Syntax (Toggle Plain Text)
#include<iostream.h> #include<conio.h> #include<stdio.h> #include<string.h> void main(){ clrscr(); 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; do{ do{ cout<<"This is a slumbook simulating program"; cout<<"\nInput username to enter the program:"; cout<<"\nUsername:";cin>>usrnem; cout<<"\nInput password:";cin>>pasw; strcpy(usrnem, "wern"); strcpy(pasw,"nrew"); strcmp(usrnem,usrnem); strcmp(pasw,pasw);{ }while(pasw=="nrew"); cout<<"\nWelcome"; cout<<"\nMenu:"; 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++; } }while(choiz!=6); 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:"<<" "; gets(name[index]); 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++){ cout<<"\nName:"<<neym[a];cout<<"\nAddress:"<<adr[a]; cout<<"\nHobbies:"<<hobez[a];cout<<"\nDislikes:"<<ayaw[a]; cout<<"\nAge:"<<age[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, getch(); }
Last edited by Ancient Dragon; Oct 3rd, 2008 at 7:26 am. Reason: add code tags
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.
delete use of conio.h and studio.h -- this is a c++ program, not C.
Don't PM me with questions -- you might get a nasty PM in response. If you have a question then post it in one of the forums.
Well You take in the data from the user and then again change it back....... With the strcopy(arg1,arg2) Function in main .
•
•
Join Date: Mar 2008
Posts: 89
Reputation:
Solved Threads: 2
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.
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.
Bhoot
![]() |
Similar Threads
- pls help me.....newbie in c# here.. (C#)
- PLS help me do this program.. (C++)
- want a program to find the ip address of all the host in tha network (Java)
- My Internet Browser is Hijacked! Pls Help. (Viruses, Spyware and other Nasties)
- can somebody pls. help me out with my HJT log.. (Viruses, Spyware and other Nasties)
- connection program for sybase (C)
Other Threads in the C++ Forum
- Previous Thread: Error C2440: Char Array Addressing Problem
- Next Thread: Vector Dimensions
| Thread Tools | Search this Thread |
api array arrays based beginner binary c++ c/c++ calculator char char* class classes code compile compiler console conversion count delete deploy desktop directshow dll download dynamic dynamiccharacterarray encryption error file forms fstream function functions game givemetehcodez google graph gui homeworkhelp homeworkhelper iamthwee ifstream input int integer java lib linkedlist linker linux list loop looping loops map math matrix memory news numbertoword output parameter pointer problem program programming project proxy python random read recursion recursive reference return rpg sorting string strings struct temperature template templates test text text-file tree unix url variable vector video visual visualstudio win32 windows winsock wordfrequency wxwidgets






