Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Set up a text file consisting of student id, names and final mark The format for each line in this file is: second names,first namesimark

image text in transcribed
Set up a text file consisting of student id, names and final mark The format for each line in this file is: second names,first namesimark Some example lines are shown below Baker, Tom; 79 Cooper, Anne Marie: 81 Butcher Jack, John: 60 Tailor, June 45 Write a C program that reads in your file's name and the name of a person to search for. If the name the user typed in occurs in the file, the program must print out whether or not the person passed the course. The program must include a function that can break a string into substrings using a particular character (called a separator You must use the function twice as follows i) break the line of text into name and mark (separator a semi-colon) ii) break the name (set up by first function cal) into second names and first names (separator a comma) When running, your program should look like the examples below: le 1 Type in a file name: names.txt Enter the name of a student: Anne Marie Cooper Anne Marie Cooper passed with 818. Example 2: Type in a file name: names.txt Enter the name of a student: Tailor, June June Tail r failed with 45% Example 3 Type in a file name: names.txt Enter the name of a student: Mary Butcher Jack Not a student enrolled in this course Notes 1. The data in the file has no spaces around the separators (but there may be spaces inside a name) 2. There are two different ways of entering a name to search for- compare example 1 and example 2 3. If the search name is not in the file, output should be as in Example 3 Submit your program on Stream by Wednesday 30th May 201s

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Processing Fundamentals, Design, and Implementation

Authors: David M. Kroenke, David J. Auer

14th edition

133876705, 9781292107639, 1292107634, 978-0133876703

More Books

Students also viewed these Databases questions

Question

Why do HCMSs exist? Do they change over time?

Answered: 1 week ago