Question: Write a C program that A file contains a list of student names, majors, and G.P.A.s. You are to write a program that will read
Write a C program that


A file contains a list of student names, majors, and G.P.A.s. You are to write a program that will read the contents of this file into an array of structs. The name of the file will be given on the command line. Your program should repeatedly prompt the user for a string and print out all of the information about the first student found whose name contains that given string as a substring. Information about each student will be given on three consecutive lines. For example, here is the contents of a file that contains information on two students: Dennis Ritchie CS 4.0 Amanda B. Recondwith ART 2.5 Here is an example of what you program should look like when it is executed with the text file "students.txt" as the data file. (The '' is the shell prompt.) User input is shown in bold. $ ./projecti students.txt Please enter part of a student name: Ritch Name: Dennis Ritchie Major: CS G.P.A.: 4.0 Please enter part of a student name: foo No student found Please enter part of a student name: O Name: Amanda B. Recondwith Major: ART G.P.A.: 2.5 Please enter part of a student name:
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
