In this lab, students track their own fitness activities for a week. They submit this data which becomes some of the test data for the lab. Based on the students' activities, the program computes the number of equivalent miles each student has walked and the total number of miles walked by everyone together. Output is sorted from most miles walked to least miles walked.
This is a lab for late in the semester of a CS 1 course. It requires students to use text files and an array of structures.
Learning objectives:
- Compiling, linking, executing a program
- Developing an algorithm
- Testing a program
- Using the C++ syntax and programming constructs of standard I/O, variables and arithmetic expressions, selection statements, structures, arrays
Prerequisite knowledge: Students must have already been exposed to standard I/O, variables, arithmetic statements, selection statements, loops, functions, arrays, structures, and text files.
The lab could be easily modified to use a class instead of a structure and an array of objects.