Difference between revisions of "IB CS1 1st Quarter Exam"

From WLCS
Line 5: Line 5:
 
* Part III: Open-book - answer the following questions on the computer and print out your answers
 
* Part III: Open-book - answer the following questions on the computer and print out your answers
  
<!--
 
 
<pre>
 
<pre>
 
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.  Be sure to put your name on your answer sheet.
  
  
17. Write an if statement that will check if a variable x is divisible by 18. If it is divisible by 18, then print a message that says x “is divisible by 18” and if it is not, then print out a message that says that it is not. (3 marks)
+
17. Write an if statement that will check if a variable x is divisible by 18. If it is divisible by 18, then print a message that says x "is divisible by 18" and if it is not, then print out a message that says that it is not. (3 marks)
  
  
Line 29: Line 28:
  
 
# Insert your answer to number 19 here
 
# Insert your answer to number 19 here
 
+
</pre>
-->
 

Revision as of 13:50, 30 October 2008

Directions: There are 3 parts to the exam.

  • Part I: Closed-book scantron - Do NOT write on the exam, only write on the scantron
  • Part II: Closed-book paper - You will write on this part
  • Part III: Open-book - answer the following questions on the computer and print out your answers
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.


17. Write an if statement that will check if a variable x is divisible by 18. If it is divisible by 18, then print a message that says x "is divisible by 18" and if it is not, then print out a message that says that it is not. (3 marks)


# Insert your answer to number 17 here


18. Write the function definition for a function named rectangleArea(height, width) that takes two parameters: height and width. The function should return the area of the rectangle. (4 marks)


# Insert your answer to number 18 here


19. Write the while loop that prints out the following sequence of numbers: (6 marks)


0 3 6 9 12 15 18 21


# Insert your answer to number 19 here