Programming and Terminology Warm Up
Due Monday at the end of class
Objectives
- To review how to program in Python program
- To review the terminology of programming so that we are better able to communicate throughout the semester (and beyond).
- To start to analyze software design decisions
Motivation
In computer science, we often need to think about our code at multiple levels: the high-level big picture and then the more detailed view of how each method is implemented. We also need to be able to communicate with teammates/colleagues/customers, so we need to make sure we understand the terminology and use it well. I also may use some terms more or less often than your previous faculty. And, finally, it's probably been a minute since you last programmed, so let's get warmed up!
Part 1: Reviewing Python Programming and Terminology
- Read through the Python code provided and answer the following
questions--just write/sketch on the code handouts:
- What is the role of each file? Of each class?
- How do the classes fit together?
- Download this Word document from Box.
- Complete the table while also marking up the code provided (e.g.,
highlighting/circling examples of the terms in the Word
document).
We'll do this in phases: 1) on your own, 2) with your neighbors, and 3) looking online.
- Answer the questions in the document.
Part 2: Design Discussion Questions
Do not start until after we have reviewed Python (Part 1 above) as a class.
Motivation: Throughout this class, we'll talk a lot about design decisions. You and/or your professors have been making design decisions for awhile.
Let's consider some design decisions from the code. For each of the following questions, first confirm my first intro/set up statement. Then, answer the question.
turn
is an instance variable of theGame
class. Is it better design forturn
to be a local, instance, or class variable? Justify your answer.user_input
is a local variable in thegetInput
method of theConnectFour
class. Is it better design foruser_input
to be a local, instance, or class variable? Justify your answer.RANKS
is a class variable of theCard
class. Is it better design forRANKS
to be a local, instance, or class variable? Justify your answer.tokens
is an instance variable of theConnectFour
class. Is it better design fortokens
to be a local, instance, or class variable? Justify your answer.Player
is a class inwar.py
. Is it better design for thePlayer
class to be defined inwar.py
or ingame.py
? Justify your answer.- (Question, courtesy of some eagle-eyed students)
War
'sstep
method takes as a parameterdummyInput
. What purpose does it serve?
Submitting your assignment
Show Professor Sprenkle your assignment before class on Wednesday.
Grading (10 pts)
You will be graded on making a good-faith effort in identifying and defining the terms.