exam3_solution

exam3_solution - SOLUTION Name ECE264 Advanced C...

Info icon This 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 1 / 40 1 2 (a) / 5 (b) / 5 (c) / 10 (d) / 10 (e) / 10 3 / 10 4 / 10 Total / 100
Image of page 1

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

View Full Document Right 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.
Image of page 2
Image of page 3
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern