Tutorial: Classroom Seating
Visual C++ Programming
2
Problem Analysis Create a classroom seating chart Color code the seats to match student
performance levels Red = below the mean Yellow = mean up to 90% Green = 90% or better
Design
Visual C++ Programming
3
Interface sketch Variables and constants
Control Table Constants
NUMROWS, NUMCOLS Data Table Drawing objects
Design (continued)
Visual C++ Programming
10
Algorithm for seating chart Draw a rectangle in every column in each
row Algorithm for coloring seats
For each seat Determine the student score Determine color of the seat based on score Color the seat rectangle
Trace sample data to test the algorithms
Development
Visual C++ Programming
19
Create the interface Code the constants and instance
variables Code Form1_Load() Code btnShow_Click() Code btnGroups_Click()
Testing
Visual C++ Programming
29
Verify that interface matches Figure 7-17 Verify that the mean is correct Make sure that the seats are colored
correctly to match the three levels of student performance