i have a code that is suppose to read from a file. but im trying to make the code output only the users first or last name from the file. if the file does not get first or last name, then the program will get a message. how do I write it?
im trying to make the program get the names from the file but I want to do it as first name "or" last name. if they enter any other name they would get an error messege saying it wasent in the file
yes thats what i meant. im trying to have the program the first or last name from a file.....then actually showing the user first names or last names '
So you'd read all the names in the firstName, lastName and grades array(quizzes?) for each student into the struct array.
Are you going to ask the user if they want to search by first or last name? Then use the name they input with a search function that loops through the struct array looking for a record with that first or last name? Once the record is found, they can then update information for that student?
Maybe put that whole search process in a loop so the person can update another student if they want to?
Once records are updated, do you need to output the student data back into a file?
no i dont need to put it back in the file i just want the program to read the names from the file so that if they type a name thats not on the file, the program exits. i need that certain code so can i do a code for the average of the test and quizzes. how do i write it?