- Jan 22 - Read Chapters 1-5 in the text.
Copy, compile, and run this program, using the C++ compiler of your choice. Note: you must choose values for blinking items.
- Jan 29 - Read Chapters 17-20, 24, 30-31 in the text.
Write a program in C++ that plays "guess the number I am thinking of" with the user. Have your program choose a number and the user will try to guess it. Print appropriate messages if the guess is greater than, less than, or equal to the number. Write your program so the user can play again or quit after each game. Use character input for specifying playing again or quitting, and allow the user to enter either upper or lower case characters.
5 points extra credit if you figure out how to make the computer choose numbers randomly.
- Feb 5 - Read Chapters 6, 22, 23 in the text.
Decide on a project (like the train one in the book) to do for the rest of the class.
Write a program in C++ that allows the user to choose to enter either a character, an integer or a float, and then you will change the data they enter any way you want to. Print out the changed value in the calling function. Use call by reference to return the value at least once. Use the function return process to return the value at least once. Use overloaded functions to do the changing.
- Feb 12 - Read Chapters 7-9, 45-46 in the text.
Create classes for at least 2 things in your project and write a function that does computations with them, similar to the example of the box car and the tank car in Chapter 9. Write a program in C++ that creates instances of each class and does the computation for each instance, similar to the example in segment 155.
Put all the declarations in a .h file and all the code in another file. Hand in output for only 1 run, since they will all be the same.
- Feb 19 - Read Chapters 10-14, 34 in the text.
Make the member variables of your classes from Program 4 private. Make the overloaded function in Program 4 member functions of your classes. Make a default constructor and at least one constructor with parameters for each of your classes. Make reader and writer functions for the member variables that you want other parts of the program to read and write (at least one member variable in each class must be accessible via reader and writer functions) for all of your classes. Put cout statements in each of your member functions that identify which is being used (e.g. cout << "in thisclass::read_thisval\n";). Put cout statements in main that show that your writer functions work (e.g., cout the reader function then invoke the writer function, then cout the reader function again to show that the value has changed).
Hand in hardcopy of your source code and header file and the output of your program for 1 run.
- Feb 26 - Mid-term Exam
- Mar 4 - Spring Break
- Mar 11 - Read Chapters 15-16, 35, 45 (46 optional) in the text.
(1) Reorganize your class hierarchy following the principles of design in chapter 16.
(2) Reorganize and expand your Program 5 so it contains at least one base class and at least 3 derived classes.
(3) Remove the cout statements in each of your member functions that identify which is being used (e.g. cout << "in thisclass::read_thisval\n";), EXCEPT FOR THE CONSTRUCTORS - see segment 239. (If you didn't put cout statements in your constructors in Program 5, put them in for this one!)
(4) Remove the cout statements in main that show that your writer functions work (e.g., cout the reader function then invoke the writer function, then cout the reader function again to show that the value has changed).
(5) For each of your classes write a print member function that prints out all the values of the member variables in an easy to understand format.
(6) Create at least one object for each class and use the print member function with each object.
Hand in your old and new class hierarchy along with a paragraph that explains how you followed the principles of design in chapter 16. Also hand in hardcopy of your source code and header files and the output of your program.
- Mar 25 - Read Chapters 21, 25, 26, and 40 in the text.
MAKE YOUR PROGRAM FUNCTIONAL, i.e., make it do what you had in mind when you chose your topic. Make an array of objects related to your topic (like the train of railroad cars in the text). Read in the info to fill the array from a file. Print a "report" to another file.
Hand in hardcopy of all your source code and header files, your input and output files, and the output of your program.
- Apr 1 - Read Chapters 27-29 in the text.
MAKE YOUR PROGRAM FUNCTIONAL, i.e., make it do what you had in mind when you cho
se your topic. Change the array of objects to an array of pointers to base class objects and fill it with various derived class objects.
Hand in the corrected program 7 from your classmate - (100 - your errors in grading) will be your program 8 grade.
- Apr 8 - Read Chapters 41-44 in the text.
Put destructors in your classes with couts in them so you can see when they are called.
- Apr 15 - Read Chapters 48-49, 38 in the text.
If you hand in the Final Project today, you get 10 points extra credit.
The Final Version of your Project must do something useful and/or interesting to someone who has not taken the class. Output should be professional looking. Class member variables must be private or protected. You must use an array of pointers to class objects or do something just as cool! (Remove the couts that were just for illustrating how class member functions work.)
- Apr 22 -
The final will be the same style as the midterm and will cover all the chapters that have been assigned.