hw9 - Homework 9 (3-6) 3. (Ch. 13, Problem 4) Write a...

Info iconThis preview shows pages 1–4. Sign up to view the full content.

View Full Document Right Arrow Icon
Homework 9 (3-6) 3. (Ch. 13, Problem 4) Write a program to save the following sequence of numbers in a file named number.dat . Then, read the data in this file and display the numbers on the screen. 1 3 5 7 9 11 4. (Ch. 13, Problem 15) If a student's information in saved in a file rwstudent1.data with the following format, 101:John:12:11:1985:3.33 , modify Program 13.8 to read the student information in this file. a.) Use function fscanf() to read the data file.
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
b.) Use function fgets() to read the data file first. Then process the input string using function sscanf() .
Background image of page 2
5. (Ch. 13, Problem 16) Student record in a class are stored in a student data file with the following data format. 1 John Smith 101 3.4 2 Mary Jone 102 3.2 3 Bill Bush 103 2.4 4 Gorge Clinton 104 2.8 (more data) The first field in a row is the student number of the class, the second is the student name, the third is ID, and the last one is the GPA. Write a program called prog.c , to read a student data file specified at the command line,
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 7

hw9 - Homework 9 (3-6) 3. (Ch. 13, Problem 4) Write a...

This preview shows document pages 1 - 4. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online