C++ Programming: From Problem Analysis to Program Design, Eighth Edition 9-6
Quick Quiz 2
1. What types of aggregate operations are allowed on structs?
2. Can struct variables be passed as parameters to functions? If so, how?
3. True or False: A variable of type struct may not contain another struct.
4. True or False: A variable of type struct may contain an array.
Class Discussion Topics
1. With the advent of object-oriented programming, is it ever necessary to use C-type
structs rather than classes? If so, when? What are the advantages or disadvantages of
each approach?
2. Discuss how the object-oriented concept of reusability relates to structs, structs
Additional Projects
1. Write a program that reads students’ names followed by their test scores. The program
should output each student’s name followed by the test scores and the relevant grade. It
should also find and print the lowest, highest, and average test score. Output the name
of the students having the highest test score.
2. Write a program that lists all the capitals for countries in a specific region of the world.
Use an array of structs to store this information. The struct should include the