Course Level
CS1
Knowledge Unit
Fundamental Programming Concepts
Collection Item Type
Lab
Synopsis

In this laboratory, student are asked to examine integer values that are too large or too small and may fall outside the allowable range for their data type. This may lead to undefined behavior that can both reduce the robustness of the code and lead to security vulnerabilities.

Recommendations

An internet connection is needed for this assignment since it is set up as an interactive online experience.

This activity comes from a series of activities called Cyber4All at Towson University. This assignment can be done not only in C++ but also in Java. It is important to note however only this assignment in C++ has been peer reviewed.

Engagement Highlights

Before attempting this laboratory, students are given many practical examples of when an integer error can lead to unexpected behavior or may be exploited to cause a program crash, corrupt data, or allow the execution of malicious software. Number of users on a Facebook page, scheduling software for airlines, and even programs for launching a rocket all can be subject to unexpected behavior if integer errors occur. Relating this assignment to real world applications helps to make this assignment Meaningful and Relevant to students.

Additionally, as student move through the laboratory, there are several checklists, multiple choice questions, and opportunities for discussion, which allow for immediate feedback. In this way this laboratory offers Student-Centered Assessment.

Materials and Links

Computer Science Details

Programming Language
C++

Material Format and Licensing Information

Creative Commons License
CC BY-SA