CSCI 150 HW: CodingBat Conditional Practice and By-Hand Tracing

Due: Monday, September 23

This homework set has two components:

  • CodingBat – where you will write a bit of code (see below) and it will be automatically assessed
  • By-hand tacing, which you will turn in an on-paper version in class

CodingBat

You will want to make an account on CodingBat. Please use your Hendrix email as your account email. Please also keep up with your own password – there is no way for me to recover it for you!

Be sure to share your progress with me, by going to “prefs” and entering your instructor’s email address (ferrer@hendrix.edu or seme@hendrix.edu) in the “Teacher Share” box.

You should complete at least seven of the following. Completing more than seven is highly recommended for additional practice:

By-Hand Tracing

Turn in your by-hand tracing for each section of code shown below. You are strongly encouraged to check your answers by typing the code into a Python interpreter (i.e. Kaggle). Your by-hand work should show the updating of values as necessary.

1.

x = 7
y = 2
x = y - 3
z = x + y ** 3

2.

a = 2
b = a + 4
a = a + 3

if a == a + 3:
  c = 7
  a = 1
else:
  c = a * b
  b = 10

Specifications

  • To be considered complete you must finish at least 7 of the CodingBat exercises and all values in your tracing must match the correct final values.