This preview shows pages 1–3. Sign up to view the full content.
This preview has intentionally blurred sections. Sign up to view the full version.View Full Document
Unformatted text preview: UAH
CPE 212 Purpose Project 1 Understand constructing your own class. Background With this project you must design your own class and manipulate the class for the calculations and selection of the winner. Tasks Perform programming assignment in the attached description. Meet each requirement. Design and implement your own classes. Deliver Your source with the correct headers, electronic and printout. Makefile if you used Unix. MS Visual project if WinNT Executable file for your environment. Anything else required by the syllabus UAH
CPE 212 Project 1 Attachment You have been asked to keep track of doughnut sales for a school. Because the classroom that sells the most boxes of doughnuts gets a pizza party, you need to keep track of the sales and determine the winner. Create a classroom user defined type that contains the ability to store the classroom teacher's name, the room number where the class meets, and the number of boxes that the classroom sells. Provide a bool type to flag the winning classroom. Be sure to have a member function to print, save and load the class. Provide a default constructor to initialize the type. Create a dynamic array of your user defined types to hold all of the classrooms in your school. Search your array after entering all the data, and print the winning class. You must save the school to a disk file and load it from a disk file UAH
CPE 212 Notes to the Grader Students can create classes with either struct or class keyword. Students must use a dynamic one dimensional array of classes that is initialized at run time to represent a school. Students must use new, not malloc or calloc to create the array of classrooms Students must use delete to remove the array when they are finished, not free. Students must use fstream objects (ifstream and ofstream) to save and load the school ...
View Full Document
This note was uploaded on 06/09/2008 for the course CPE 212 taught by Professor Skipper during the Spring '07 term at University of Alabama in Huntsville.
- Spring '07