{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

mid_sample_spr10_solutions

# mid_sample_spr10_solutions - SOLUTIONS-CSci 1113 Fall 2009...

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

1 --- SOLUTIONS --- CSci 1113 Fall 2009 - Sample Midterm Exam Questions Note: These are sample questions from previous exams. The actual exam may have fewer questions. 1. Terms and definitions a) What are the three structures of structured programming? Sequence Selection Repetition b) What is a post-test loop? A loop in which the expression is tested after the loop body. c) What are the values a bool variable can have? true, false d) What is a variable? A variable is a location in memory where a value can be stored for use by a program. e) True or false? Every C++ program must have a main() function.___ true ___ 2. Describe the exact output that is produced by the following program segments. Use an underscore (_) to indicate blank spaces. double PI = 3.14159; int NUM = 73; cout.setf(ios::fixed); cout.setf(ios::showpoint); cout.precision(3); cout << "NUM=" << setw(6) << NUM << "\nPI=" << PI << endl; NUM=_ _ _ _73 PI=3.142

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

View Full Document
2 3. Write the statements, including a loop, required to calculate y(t) from the equation: < + + - = 0 5 3 0 5 3 ) ( 2 2 t t t t t y for values of t between -9 and 9 in steps of 3. Display each value of t and y(t). You do not need to write a complete program but you should include declaration statements for all the variables that you use.
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}