Assessment Tool

Lecture 19:  Strings

Content Tested:  String library functions

Lecture Content:

Goals:

Assessment Technique:  Categorizing Grids

Purpose:

This activity allows instructors to see if students understand the mapping of operators they have seen and the new string functions.
 

Activity:


Today we learned about strings and the string library functions.  Fill in the grid below with the appropriate code using string library functions.  The column on the left assumes the variables a and b are integers.  The column on the right assumes a and b are strings.  You answers in the right column should be the analogous operations on strings.
 
 
int variables: string variables:
a = b  
a == b  
a = a + b  
a < b  
(double) a  

 

Possible Solutions:

 
int variables: string variables:
a = b strcpy(a, b) 
a == b strcmp(a, b) == 0 
a = a + b strcpy(a, b) 
a < b strcmp(a, b) < 0 
(double) a strtod(a)

 
 

Possible Uses of Activity: