CPSC120
Fundamentals of Computer Science

In-class Activity 26

  1. Modify the decmial to binary conversion program binary.py from lab 6 so that it can convert numbers larger than 255 and so that it does not pad number smaller than 128 with zeros.

  2. Modify the projectile path drawing program projectile.py from assignment 4 so that the simulation ends when the projectile reaches the edge of the window.

  3. Create a Python function that takes a dictionary and a value. The function should remove the first occurance of the specified value from the dictionary. If the value is not in the dictionary, the function should do nothing. The function should not return anything. The function should use a while to iterate through the dictionary so that it does not iterate over more entries than is required.

  4. Create a Python function that takes a string and prints the letters of the alphabet in descending order of how frequent they are in the input string.