help me plsss what will be the codes for this??

Sample Output

Recording System
1) Add
2) View
3) Search
4) Delete
5) Exit

All Data Should be stored in a TextFile. Create a Structure with at least 5 structure member. Create a function for Adding, Viewing, Searching and Deleting in a TextFile.

All surname start with a,c,e,g,i,k,m,o,q,s,u,w,y create a struct Country.

All surname start with b,d,f,h,j,l,n,p,r,t,v,x,z create a struct University.
Gee, another one. Please put some backbone into it. If you find C++ hard, you should study it first. There's one tutorial here in this site. Look it up in the Documentation section.

If you get into trouble with a specific part, post a question, but don't ask for the entire homework.
Struct Country
{

char a[30];
char b[30];
char c[30];

ect.

}

struct Univ
{

char a[30];
ect
}

int NumbUniv= //your number of universities

Univ Universities[NumbUniv];

void WriteToFile(char Filename, char Surname, char University)
{

char fyle=Filename;
char name=Surname;
char Univ=University;

FILE *file;
file=fopen("C://yourfile.txt", rw);
frprintf(file, name);
fprintf(file, Univ);
fclose(file);

}

I started with the intention of using the structs but You don't really need the structs. I guess if you are trying to parse and read from a huge database into a file you could do that. But for any small amount of names and universities you could just use variables. If you already have a database or such a large amount of names i dont see how you couldn't have a more traditional method to store them.

edit i forgot about the rest. When searching and reading you are going to have to partition the file somehow so you know where names start and end and where universities start and end.

I think the most adopted method is to just use ";". If you can store a name and university by line. Which using my above code you would just add "/n" to the array and it would start a new line. Then before each letter in the file you could put the number of names beginning with each letter. This way you know how many lines to skip to get to the next letter. So the first 26 lines would simply be Numerical (maybe not with this method since it only accepts chars) values. From there on out you would simply write the surname "/n" then univeristy name.

But the method i gave above only works with chars. You might take a look a fstream. http://courses.cs.vt.edu/~cs2604/fall02/binio.html
Last edited on
Topic archived. No new replies allowed.