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.
turnis an instance variable of theGameclass. Is it better design forturnto be a local, instance, or class variable? Justify your answer.user_inputis a local variable in thegetInputmethod of theConnectFourclass. Is it better design foruser_inputto be a local, instance, or class variable? Justify your answer.RANKSis a class variable of theCardclass. Is it better design forRANKSto be a local, instance, or class variable? Justify your answer.tokensis an instance variable of theConnectFourclass. Is it better design fortokensto be a local, instance, or class variable? Justify your answer.Playeris a class inwar.py. Is it better design for thePlayerclass to be defined inwar.pyor ingame.py? Justify your answer.- (Question, courtesy of some eagle-eyed students)
War'sstepmethod 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.