Assessment Tool

Lecture 3: Variables, Values, and Types

Content Tested: Variable Identifiers

Lecture Content:

Goals:

Assessment Technique:  Categorizing Grids

Purpose:

This activity allows instructors to see if students understand appropriate variable naming style and illegal variable names.
 

Activity:

In today's lecture we saw rules for naming variables when programming in the C language.  In your group (or as an individual) generate variable names that fit the following three categories:  good style and legal name, poor style and legal name, illegal name.
 
 
Good Style and Legal Name Poor Style and Legal Name Illegal Name

 
 
 
 
 
 
 
 
 

 

   

Possible Solutions:

 
Good Style and Legal Name Poor Style and Legal Name Illegal Name
num_apples
numApples
income
profit
a
first_integer_input_by_user (poor description and too long to type)
input1 (poor description of contents)
void (reserved word in C)
12days (can't begin with a number)
num-apples (can't include - )
num Apples (can't have spaces)

Possible Uses of Activity: