q1 sol - 55 85 A 10 A1 161 4. Here is a octal number....

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

View Full Document Right Arrow Icon
CSCI.1100 Computer Science I Quiz 1 September 6, 2007 Closed book, closed notes, no computers or calculators of any kind. Name: RCS login Circle your lab section: (01 MTh 10:00) (02 MTh 12:00) (03 MTh 2:00) (04 MTh 4:00) (05 MTh 6:00) (06 MR 10:00) (07 TF 10:00) (08 TF 12:00) (09 MR 12:00) (010 TF 2:00) You will have 15 minutes to complete this test. Make sure you do not spend too much time on any question. The time spent on each question should be proportional to the number of points 1. For each problem circle the type of error message that you will get from the computer (6 points) a. A syntax error in your program Compiler error Linker error Run time error b. A missing library in your project Compiler error Linker error Run time error c. The wrong logic in an expression Compiler error Linker error Run time error 2. Here are some binary numbers. Convert each one to its decimal equivalent (4 points) 1011 11
Background image of page 1

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

View Full DocumentRight Arrow Icon
1100 12 11000 24 1111111 127 3. Here are some hexadecimal numbers. Convert each to their decimal equivalent (3 minutes – 3 points)
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: 55 85 A 10 A1 161 4. Here is a octal number. Convert it to its decimal equivalent (1 point) 11 9 5. Here is a binary number. What is its hexadecimal equivalent (2 points). 1111 0000 1100 0010 F0C2 6. Here are four complete programs. What would each one print. If the program would have a compiler error, say so. (1 point each). a. #include <iostream> using namespace std; int main () { int a, b; a = 10; a = 10 b = 106 b = a * a + 6; cout << "a = " << a << " b = " << b << endl; return 0; } b. #include <iostream> using namespace std; int main () { int a, b; Compiler error C is undefined b = 5; a = b * b + c; cout << "a = " << a << " b = " << b << endl; return 0; } c. #include <iostream> using namespace std; int main () { int a, b; a = 1 b = 25 b = 25; a = b % 4; // % is division remainder cout << "a = " << a << " b = " << b << endl; return 0; } d. int main () { int a, b, c; b = 25; Compiler error c = 4; a = b / c; cout << "a = " << a << " b = " << b << endl; return 0; }...
View Full Document

This note was uploaded on 04/10/2008 for the course CSCI 1100 taught by Professor Hardwick during the Spring '08 term at Rensselaer Polytechnic Institute.

Page1 / 4

q1 sol - 55 85 A 10 A1 161 4. Here is a octal number....

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

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