CIS15BG - CIS 15AG 1 Test 1 Questions: Chapters 1-5...

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

View Full Document Right Arrow Icon
CIS 15AG Test 1 Questions: Chapters 1-5 Computer Science is no more about computers than astronomy is about telescopes. - Edsgar W. Dijkstra Chapters: 1 - 5 There are 10 questions, 10 points each: 7 exercises and 3 problems. Note that while all questions carry the same weight, some will take considerably more work to solve. ______________________________________________________________________ 1. (10 Points ) You are given two files both containing machine language. The first file, let's call it FILE_1 has 161KB, and the second one, FILE_2, has 3 KB. Both files were created when working on a C program. (A) (2 Points ) Which one represents the object module? (B) (8 Points ) Why? _______________________________________________________________________ _ 2. (10 Points ) Define a float variable named amount , an int variable num , and two char variables letter1 and letter1 , then code one statement that will read the following data stream entered by the user from the keyboard into the variables described above. A B 23.18 45 // Local Declarations // Statements 1
Background image of page 1

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

View Full DocumentRight Arrow Icon
CIS 15AG Test 1 Questions: Chapters 1-5 _______________________________________________________________________ _ 3. (10 Points ) Predict the output. int num = 725; int a = 2; int b = 3; int c; c = a + 5 * b; // Write the output below printf( "%d\n", c ); // num %= 100; printf( "%d\n", num ); // num = 725; c = num / 100 * 100; printf( "%d\n", c ); // c = a + b++; printf( "%d %d\n", b, c ); // b = 3; c = a + ++b; printf( "%d %d\n", b, c ); // a = 5; b = 7; c = !(a < b); printf( "%d\n", c ); // c = a > 0 && a < b; printf( "%d\n", c ); // c = b <= 0 || b >= a; printf( "%d\n", c ); // c = a < b || a > 0 && b != 9; printf( "%d\n", c ); // c = a < b && a > 0 || b != 9; printf( "%d %d\n", b, c ); // 2
Background image of page 2
CIS 15AG Test 1 Questions: Chapters 1-5 3
Background image of page 3

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

View Full DocumentRight Arrow Icon
CIS 15AG Test 1 Questions: Chapters 1-5 _______________________________________________________________________ _ 4.
Background image of page 4
Image of page 5
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 12

CIS15BG - CIS 15AG 1 Test 1 Questions: Chapters 1-5...

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

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