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

From WLCS
Line 12: Line 12:
  
  
# Insert your answer to number 17 here
+
### Insert your answer to number 17 here ###
  
  
Line 18: Line 18:
  
  
# Insert your answer to number 18 here
+
### Insert your answer to number 18 here ###
  
  
Line 27: Line 27:
  
  
# Insert your answer to number 19 here
+
### Insert your answer to number 18 here ###

Revision as of 13:53, 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)


      1. 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)


      1. 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


      1. Insert your answer to number 18 here ###