0% found this document useful (0 votes)
12 views4 pages

Narrative

The document outlines a user authentication and record management system for student data. It includes functions for adding, deleting, editing, and displaying student records, with checks for existing records and error handling. The system prompts users for actions and manages data storage in 'userdata.bin' and 'data.bin' files.

Uploaded by

βεαπsᬁ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views4 pages

Narrative

The document outlines a user authentication and record management system for student data. It includes functions for adding, deleting, editing, and displaying student records, with checks for existing records and error handling. The system prompts users for actions and manages data storage in 'userdata.bin' and 'data.bin' files.

Uploaded by

βεαπsᬁ
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 4

Narrative

Description:

START
Call authentication function
If a password and username is on userdata.bin
Prompt user to enter username and password
If password and username doesn’t match userdata.bin
Print incorrect username or password
Loop back to start
Else prompt user to make password and username
Save username and password to userdata.bin file

Prompt user to enter action to do (add record, delete record, edit record, display records or exit)

While True (infinite loop)


If the user selected add record
Open data.bin file
Prompt user to enter name of student
If name of student already stored in data.bin file
Print record already exists
If the record is not in the data.bin file
Prompt user to enter grade, age and class (name is already collected)
Store data on data.bin file
If user selected delete record
Declare tracker as integer equal to 0
Open data.bin file
Create temp.bin file
Prompt user to enter name of student to delete
While there is a record in data.bin
If student name in data.bin is not matched to student name to remove
Write that record to temp.bin file
Else if name in data.bin is equal to student name to remove
Set tracker to 1
Close data.bin and temp.bin files
If tracker is 0
Print record not found
Remove temp.bin file
If tracker is 1
Remove data.bin file
Rename temp.bin to data.bin
if failed to remove data.bin or rename temp.bin
Print Problem Occurred
If user selected edit record
Declare tracker2 as integer equal to 0
Open data.bin
Prompt user to enter name of student record to edit
While there is a record in data.bin
If name of student to record is match with a name of student record in data.bin
Prompt user to enter field to edit
Set tracker2 to 1
If field entered name
Prompt user to enter new name
Change student name in data.bin to name entered
If field entered is grade
Prompt user to enter new grade
Change student grade in data.bin to grade entered
If field entered is class
Prompt user to enter new class
Change student class in data.bin to class entered
If field entered is age
Prompt user to enter new age
Change student age in data.bin to age entered
If record is 0
Print record not found
Close data.bin
If user selected display record
Declare disprec as integer equal to 0
Print which record do you want to display (type all to display all records)
Prompt user to enter name of record to display
While there is a record in data.bin
If name entered is equal to a record in data.bin
Print that record
Set disprec to 1
Else if user entered all
Print all records
Set disprec to 1
If disprec is 0
Print record not found
If user selected exit
Break while loop
END

You might also like