Unformatted text preview: Exam 1 Exam Structure 1. Approximately 5 questions total
○ 2 questions focused on translating between C and LC-3 (e
○ 3 questions focusing on C concepts
Will include short CodeLab-like code snippets
○ General statement: This will include all material covered up to (but not including)
2. You can expect something like a mix between these two testing formats
○ Example 1 (Tuck)
○ Example 2 (Byrd)
○ Note - there may be some questions in these two examples on material not
included in the “Topics” list below (example - extended function problems). If it is
not included there, you will not be tested on it for Exam 1.
3. No cheat sheets, but I will provide you with C and LC-3 reference sheets that contain a
precedence table, a list of all LC-3 instructions, and the ASCII table.
4. Please be aware of the testing policies before you come. You will see something like
this at the top of the exam paper. Read it now so you can prepare accordingly:
This is a closed book and closed notes test. You are not allowed to have anything on your desk
other than pencil and this exam paper during the test; this includes calculators or electronic
assistance of any kind – even cell phones.
You may not leave to go to the restroom. Please go before the exam starts.
You may not ask questions. If something is confusing, write a note beside the question and
explain your assumptions.
You must show all of your work on this exam. You will not be allowed to turn in additional
sheets of paper.
Read and sign the following statement. Failure to sign the statement will result in a zero on the
exam. Topics 1. Write a complete C program using correct syntax
a. It should compile without errors and have no major logical bugs
2. C operators, precedence, evaluation of expressions
a. Explain the meaning of all C operators (covered so far)
b. Identify an LC-3 implementation of a C operator
c. Produce an implementation of the following C operators in LC-3
- (subtraction, unary minus)
d. Evaluate an expression according to its meaning in C
e. Identify precedence of operators within a C expression
f. Interpret the type of a C expression
3. Implement or explain code using all C statements
a. List of C statements
switch (+ case)
break (know difference between switch and loop usage)
continue (only useful in loops)
1. Know how it’s different depending on the loop it’s used within
b. Interpret the execution of nested statements and show their output using any
combination of the following
Loops: do-while, for, while
c. Interpret LC-3 code as being a particular kind of statement
d. Implement LC-3 code for the following statements:
Expression statement (for operators shown above)
Convert a flowchart/pseudocode to legal C code, or convert legal C code to a detailed
Note that material may come from: TopHat questions, lecture material, anything covered
in class up to but not including functions, problem sessions, and program 1
Be able to write and use simple statements including printf, scanf, and getchar.
Challenge questions (extra credit)
a. These may be on anything covered in class up through the most recent
lecture (Lec 8), homeworks, problem session, TopHat questions, or program 1 ...
View Full Document
- Spring '08