1
University of Maryland College Park
Dept of Computer Science
CMSC216 Fall 2012
Midterm IIIKey
Last Name
(PRINT): _____________________________________________________
First Name (PRINT):
_____________________________________________________
University Directory ID (e.g., umcpturtle)_____________________________________
I pledge on my honor that I have not given or received any unauthorized assistance on this examination.
Your signature: _____________________________________________________________
Lab TA (Circle):
Robert (0201/0202)
Anderson (0102/0304)
Jonathan (0203/0303)
Kotaro(0301/0302)
Scott(0101, 0103)
Instructions
Write your name now; we will not wait for you at the end.
This exam is a closed-book and closed-notes exam.
Total point value is 200 points.
The exam is a 50 minutes exam.
Please use a pencil to complete the exam.
WRITE NEATLY.
You don’t need to use meaningful variable names; however, we expect
good indentation.
Grader Use Only
#1
Problem 1 (Process Control)
(90)
#2
Problem 2 (Assembly)
(110)
Total
Total (200)
(200)

2
Problem #1 (90 pts) Write a program that first capitalizes and then adds line numbers to input provided via the standard input. The program will use the capitalizeprogram to turn standard input into capitalized text, and cat –nto add line numbers. The capitalizeand cat –n programs rely on standard input and output for I/O. For this problem you can assume all system calls are successful (you don’t need to handle errors). Use execlp in your implementation.
