exam3_solution

exam3_solution - SOLUTION April 17, 2008 Name _ ECE264...

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

View Full Document Right Arrow Icon
SOLUTION April 17, 2008 Name _________________________________ ECE264 Advanced C Programming Exam 3 Solve the following problems. The number of points for each problem is shown next to the prob- lem and in the table below. The outcomes corresponding to each question are also shown. Use only the space provided to solve each problem. Problem Points Outcome iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 1 / 40 1 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 2 (a) / 5 (b) / 5 (c) / 10 (d) / 10 (e) / 10 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 3 / 10 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii 4 / 10 iiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiiii Total / 100 c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c c
Background image of page 1

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

View Full DocumentRight Arrow Icon
- 2 - Problem 1 (40 points) Complete the following program such that it would have the following functionality. In part (a) the program reads four-digit integers from a file called any_dig, and stores them in an array called a4. The program should read at most four digits at a time. For example, if any_dig contains 123456 7890012, the program should read 1234 into a4[0], then 56 into a4[1], then 7890 into a4[2], and finally 012 into a4[3]. If the file any_dig contains characters other than digits and white spaces, the program should stop reading when it encounters the first character that is not a digit or a white space. In part (b) the program prints the numbers stored in a4 into two files called four_dig1 and
Background image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/26/2008 for the course ECE 264 taught by Professor Pomeritz during the Spring '08 term at Purdue.

Page1 / 7

exam3_solution - SOLUTION April 17, 2008 Name _ ECE264...

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

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