Difference between revisions of "IB CS1 2nd Quarter Exam"

From WLCS
 
(7 intermediate revisions by the same user not shown)
Line 1: Line 1:
Directions: This portion of the exam is open-book, open-note, and CLOSED-person. You may use and test your code in Python. Copy and paste your answer in the spaces below. Be sure to put your name on your answer sheet.
+
Directions: This portion of the exam is open-book, open-note, and CLOSED-person. You may use and test your code in Python. Copy and paste your answer in the spaces below. Print out your answers.  Be sure to put your name on your answer sheet.  Place your exam in the Period 6 tray.
  
7. Write a loop that prints out the first N terms of the following sequence:  0, 5, 10, 15, 20, 25,
+
7. Write a loop that prints out the first N terms of the following sequence:  0, 5, 10, 15, 20, 25, ...
  
 +
<nowiki>
 
### Assume that the variable N has a value ###
 
### Assume that the variable N has a value ###
 +
</nowiki>
  
  
 +
8. Write a loop that prints out the first N terms of the following sequence:  1, 4, 16, 64, 256, ...
  
8. Write a loop that prints out the first N terms of the following sequence:  1, 3, 6, 10, 15, 21, 28, 36, 45, 55, ....
+
<nowiki>
 
 
 
### Assume that the variable N has a value ###
 
### Assume that the variable N has a value ###
 
+
</nowiki>
  
  
 
9. Write a loop that prints out every other character in the following string such that "Washington-Lee r0x0rs" is printed
 
9. Write a loop that prints out every other character in the following string such that "Washington-Lee r0x0rs" is printed
  
 +
<pre>
 
s = "W a s h i n g t o n - L e e  r 0 x 0 r s"
 
s = "W a s h i n g t o n - L e e  r 0 x 0 r s"
 +
</pre>

Latest revision as of 15:10, 13 January 2009

Directions: This portion of the exam is open-book, open-note, and CLOSED-person. You may use and test your code in Python. Copy and paste your answer in the spaces below. Print out your answers. Be sure to put your name on your answer sheet. Place your exam in the Period 6 tray.

7. Write a loop that prints out the first N terms of the following sequence: 0, 5, 10, 15, 20, 25, ...

### Assume that the variable N has a value ###


8. Write a loop that prints out the first N terms of the following sequence: 1, 4, 16, 64, 256, ...

### Assume that the variable N has a value ###


9. Write a loop that prints out every other character in the following string such that "Washington-Lee r0x0rs" is printed

s = "W a s h i n g t o n - L e e   r 0 x 0 r s"