Question
In this phase, you first need to define: 1- constant called MAXSIZE (max number of students stored) equal to 100. 2- global variable called size
In this phase, you first need to define: 1- constant called MAXSIZE (max number of students stored) equal to 100. 2- global variable called size =0 ( current number of books stored ) The main function should define the following arrays: 1- Define two array in the main function for password checking, the first array is pass[10] and the second is password[10]. The first one is to store the password that you read from user and the other one is to save the permanent password. Once the user run your program, you should ask him/her to enter the password and check if it is correct or not. You can check by comparing the entered password (pass[]) with the saved cone (password[]) using strcmp function. you should allow the user to use the system and all menus once he entered a correct password, otherwise ask him to enter the password again. (the user is allowed to enter the password three times only). 2- char names[MAXSIZE][100] ; 3- int stdID[MAXSIZE] 4- double phones[MAXSIZE]; 5- int registrationYear[MAXSIZE]; 2 you now need to implement the major parts of the functions you created in phase one as follows: void displayMainMenu(); This function will remain similar to that in phase one with one minor addition which is the option: void uploadStudentsFile (char names [], int stdID [], double phones [], int registrationYear []); This function will receive the arrays containing the students id numbers, names, phones and registration year as parameters. The function will open a file called students.txt for reading and will read all the students info (name, id, phone and registration year) and store them in the arrays. The global variable size should be set to the number of students read from the file and stored in the array. void createNewAccount ( char names [], int stdID [], double phones [], int registrationYear []); This function will receive the arrays containing the id numbers, the phones, names and the registration year. The function will check to see if the list is not full. If list is not full ( size < MAXSIZE) then it ask the user to enter a name, an id number, a phone and the registration year and will have one of three choices: 1- if the id number is already in the list ( the student with that id exists) it will display an error message (student already exists). 2- If the id number does not exist, the function will add the students name, id, phone and registration year to the end ( at index size ) of the all arrays. The global variable size should be incremented (size++). void removeAccount(char names [], int stdID [], double phones [], int registrationYear []); This function will receive the arrays containing the id numbers, the phones, names and the registration year as parameters. The function will check if the list is 3 not empty. If it is not empty (size > 0) then it will search for the id number to be removed and if not found will display an error message. If the id number exists, the function will remove it by deleting the id number, the phone, name and the registration year from the arrays and size will be decremented by 1. void viewStudentInfo (char names [], int stdID [], double phones [], int registrationYear []); This function will receive the arrays containing the id numbers, the phones, names and the registration year as parameters. The function will check if the list is not empty. If it is not empty (size > 0) then it will ask the user to enter an id number and will search for that id number. If the id number is not found, it will display an error message. If the id number is found then it will be displayed along with the name, phone and registration year in a suitable format on the screen. void editStudentInfo (char names [], int stdID [], double phones [], int registrationYear []); This function will receive the arrays containing the id numbers, the phones, names and the registration year as parameters. The function will open the file called students.txt for writing and will write to that file the name, id number, phone, and registration year of each student in the arrays. void viewList (char names [], int stdID [], double phones [], int registrationYear []); This function will receive the arrays containing the id numbers, the phones, names and the registration year as parameters. This function will print the information currently stored in the arrays.
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started