Need help plz

This is a discussion on Need help plz within the C++ Programming forums, part of the General Programming Boards category; I've arranged the code like this. 3 more functions to go. Code: CODE REMOVED Problem 1 : If i want ...

  1. #16
    Registered User
    Join Date
    Dec 2005
    Posts
    29
    I've arranged the code like this.
    3 more functions to go.

    Code:
    CODE REMOVED
    Problem 1 :

    If i want to remove student information,i must search the student with student ID.How can i search from the students.txt file ?
    What function should I use ?

    1.insert student id
    2.open students.txt
    3.search the students id from student.txt
    4.if found,remove the student name,id
    5.if not found, cout << " studen id not found";
    Last edited by vearns; 01-01-2006 at 07:23 PM.

  2. #17
    Registered User
    Join Date
    Dec 2005
    Posts
    28
    That sounds like a lot of functions, might it be possible to create a text file for each student? I am working on a database program as well, I'ts almost finished, I only need to add encryption, anyhow, it would be way easier to have separate text files for each student, for example all called student*.txt, * being the students ID. Perhaps you could make student his name or so.

    Then you could just delete the text file ( Or just its contents, you'll probably be using the same ID some other time. )

  3. #18
    Registered User
    Join Date
    Dec 2005
    Posts
    29
    Great idea !

    i just create this code :

    Code:
    cout << "Enter the name of the file you want to create: ";
    cin >> FileName;
    
        ofstream Students(FileName, ios::out);
        Students 
        <<  "********************************************************************" << "\n"
        <<  "Student ID : " << user[info].id << "\n" 
        <<  "Student First Name : " << user[info].firstName << "\n" 
        <<  "Student Last Name : " << user[info].lastName << "\n" 
        <<  "Student Day Of Birth : " << user[info].dob1 << "\n" 
        <<  "Student Month Of Birth : " << user[info].dob2 << "\n" 
        <<  "Student Year Of Birth : " << user[info].dob3 << "\n"
        <<  "********************************************************************" << "\n";
    but,the problem is....how about option no 5 ( Show Student Information )
    What input should I put ?

    i think i wanna save student information file with their ID number.
    so,it will be easier for user to use option no 5.

    the problem is, how can i save student information file with their ID number ?

  4. #19
    Registered User
    Join Date
    Dec 2005
    Posts
    29
    Problem has been solved.
    Last edited by vearns; 01-01-2006 at 07:23 PM.

Page 2 of 2 FirstFirst 12
Popular pages Recent additions subscribe to a feed

Similar Threads

  1. can any1 plz make this assignment
    By jean in forum C Programming
    Replies: 17
    Last Post: 05-13-2009, 09:19 PM
  2. plz help me...
    By sweetchakri in forum C Programming
    Replies: 1
    Last Post: 03-03-2009, 10:50 PM
  3. [Request] Need Help Plz
    By TylerD in forum Tech Board
    Replies: 4
    Last Post: 01-03-2009, 08:54 AM
  4. Anyone plz help me
    By Rose_Flowers in forum A Brief History of Cprogramming.com
    Replies: 1
    Last Post: 09-17-2003, 12:01 PM
  5. help plz plz
    By nsssn73 in forum C++ Programming
    Replies: 2
    Last Post: 06-03-2002, 08:44 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21