CS1
Operators

(Chameleon Color Change (XNA) ; Flashcard Quiz  (Console) )

 
Key Topics That Students Will Learn In This Assignment:
  1. Operators, including the modulus operator, and the integer division operator
    (including strategies for forcing real division instead of integer division, such as type casting)
    (The instructor can easily add/remove operators as needed/desired)
  2. Conditional execution control
    (if, if/else, maybe switch statements)
  3. Elementary Solution Synthesis
    (Students will add their code to an provided starter project)
Pre-requisite Knowledge That Students Must Know, Prior To Starting This Assignment:

(What students must know in order to able to complete this assignment)

  • Simple/Primitive Variables: int, double (etc)
  • Console version, as well as the pre & post tests: Basic Console Input/Output
Summary This assignment seeks to make sure that students are familiar with, comfortable using, and thoroughly understand several common operators, especially the modulus operator, and integer division.

The console version of the assignment, the students are provided with a good portion of a 'Quiz', or 'Flashcard' program.  This teaching tool will allow the user to select an operator, to select a lower & upper bound for the two random numbers that it generates, and then randomly generates A <op> B, and asks the user what the answer is.  If the user gets the answer correct, then the user is congratulated, otherwise, the user is told the correct answer.  The user is repeatedly asked to calculate the answers to the randomly generated questions ; the user chooses how many times to (s)he wants to be asked. 
Several topics (user I/O, user input validation, functional decomposition, random number generation) can be easily added to the assignment simply by removing them from the 'starter project' which is provided to the students.

In the XNA version, the students are given a starter project, and are required to fill in code that will properly set up the background of the screen, and also change the color of the circle that the player controls (based on where the circle is).  The object of the game is to move your circle onto the vertical stripe whose color is designated as the 'target color'.  If your circle is in that color, then you gain points.  At the end of the game, the player with the most points wins (currently, this is just a one player game, though :)  )
 

  Instructor F.A.Q.
Pre-Test Post-Test
Lecture Hours Prior To Assignment Due Date: 5
ACM Classification (Topics Covered):

(What the students will learn, and demonstrate, by doing this assignment)

 

From:
 

Computing Curricula 2001

Computer Science

Final Report
(December 15, 2001)


written by
 

The Joint Task Force on Computing Curricula
IEEE Computer Society
Association for Computing Machinery

 

PF1. Fundamental programming constructs

  • Basic syntax and semantics of a higher-level language

  • Variables, types, expressions, and assignment

  • Conditional and iterative control structures

     

Technical Requirements:

(What the students will learn, and demonstrate, by doing this assignment)

 

From:
 

Computing Curricula 2001

Computer Science

Final Report
(December 15, 2001)


written by
 

The Joint Task Force on Computing Curricula
IEEE Computer Society
Association for Computing Machinery

 

It is hoped that providing this information may help instructors with the accreditation process, as calling this information out will help clarify how this assignment (and from here, the overall course) meets the learning outcomes for the overall program/department, and institution.

PF1.1 - Analyze and explain the behavior of simple programs involving the fundamental

programming constructs covered by this unit.

(On the one hand, the students are given the existing code, but aren't given a detailed explanation for how it works, so they might very well decide to analyze the behavior of this (fairly) simple program. On the other hand, not only are they not required to do this, but in order to make this assignment accessible to students early in the term, the portion of the code that the students are responsible for is both isolated, and well documented, so they shouldn't ever have to do this)

PF1.2 - Modify and expand short programs that use standard conditional and iterative control structures and functions.

(The primary goal of the assignment is to modify the code that's provided by the instructor)


This document and the related materials are developed with support from Microsoft Research Computer Gaming Initiative under the Computer Gaming Curriculum in Computer Science RFP, Award Number 15871.