Skip to content

cs331ds/sample-exam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Sample Exam

By participating in this exam, you agree to the following Honor Code:

  • Personal Responsibility: You acknowledge that you are responsible for your own work and will maintain the highest standards of honesty.

  • Independent Effort: You understand that this exam is an individual effort. Collaboration with others and seeking unauthorized assistance is strictly prohibited.

  • Originality: You affirm that all work submitted for this exam is entirely your own. This precludes the use of artificial intelligence aids, online platforms, or any other resources that may provide assistance with exam questions or tasks. Be sure to turn off any AI-based features on your computer or mobile devices before starting the exam.

  • Time Constraints: You acknowledge that this exam is timed and will be completed within the designated period. Any submission beyond the allotted time will be considered invalid.

  • Confidentiality: You understand that the content of this exam is confidential. You must not share any details or discuss any aspect of the exam with other students without express permission.

Part 1: Multiple Choice

Your answers to the multiple choice questions in this section should go into the answers dictionary found in the file mc_answers.py (instructions on how to modify the dictionary are found in the file). Each question is worth 2 points.

  1. What is the answer to the Ultimate Question of Life, the Universe, and Everything?

    • a) 42
    • b) 43
    • c) 44
    • d) 45
    • e) 46

Part 2: Function Implementation

Each of the questions in this section specifies the behavior for a function you are to implement. Your solution to each question should go into the function fXX, where XX corresponds to the question number (e.g., your solution to question 1 should go into the function f01). All functions have been stubbed out for you in the file p2_answers.py. Each question is worth 5 points.

  1. Write a function that takes a list of integers and returns the sum of all the even numbers in the list.

Part 3: Class/Method Implementation

Each of the questions in this section specifies the behavior for a method you are to implement. Your solutions should go into the file p3_answers.py, and will involve modifying one or more methods/classes that have been stubbed out for you, according to the question specifications. Each question is worth 10 points.

  1. Implement the foo method of class ArrayList so that it returns the number of elements in the list that are equal to the given value.

Testing & Submission

Tests are included with this repository that help ensure your solutions return the expected types. Note that the included tests DO NOT check that your solutions are logically correct! I.e., passing the tests does not mean that you will receive any/full credit. If your code fails to run at all (e.g., due to syntax errors), you will receive no credit for the corresponding question(s).

To submit your work, simply commit and push your changes to your repository. You can commit and push as many times as you like; I will only grade the version that was last pushed before the deadline.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages