Gain experience with byte-level data file processing in serializing polymorphic collections.
Given the classes Printable, Int, Float, and
String from lecture 1, write a program that creates a polymorphic
collection of Ints, Floats, and Strings (must have two of each
and a minimum of 10 total you pick the values). This
program should then write the data out as a text file (readable
using Notepad, etc.), write the data out as a binary file
(readable using a hex editor), clear the collection, and finally
load the data into the collection from the binary file.
You must do the following:
50% Write the main algorithm that creates the collection (vector is fine) of 10 elements a mixture of Ints, Floats, & Strings.
60% Write a function that saves the collection in a text file (and modify the main algorithm to call this function).
80% Write a function that saves the collection in a binary file (and modify the main algorithm to call this function).
100% Write a function to load the collection from a binary file (and modify the main algorithm to call this function after clearing the collection). Be sure to print the newly-loaded collection after it's been loaded to verify correctness.
CPP file which compiles and works as defined above.
Any file that doesnt compile or
terminates ugly will receive no credit.
Gain experience with the Win32 GDI including message handling and BitBlt'ing from an external bitmap file;
Given the file prj2.h, write a program that displays two "battleship" grids in a a non-resizable window.
You must do the following:
50% Implement the Win32 shell application which opens a non-resizable window with a black background. This window should have a system menu which allows minimization, move, and close.
75% Draw two 8x8 grids to the screen and display titles for each grid.
100% Load the 128x32 bitmap from an external file and bitblt the 32x32 icons into each grid location based upon the value in the prj2.h grid variables.
C file which compiles and works as defined above.
A 128x32 BMP file.
Any file that doesnt compile or
terminates ugly will receive no credit.
If you'd like 15% extra credit, store the board arrays in a text file and load the information from the file when you create the application. In order to get this extra credit, you'll have to turn in an additional file: your "board" file which will contain the board information for the player's and the opponents board. In addition, you must have a commented-out section of your code showing that you were able to generate this board file from the array (effectively writing the data to the file from the array); it should be commented out b/c I don't need to see it run - I'll just validate that your created file was made from your application. Good luck!
Gain experience with Win32 threads API and the MergeSort algorithm
Given the file lecture_11.cpp as a starting point, write multithreaded version of MergeSort that spawns a new thread for each "half" of it's work. These threads should process their "halves," and when they are finished, the control thread (relative!) should then merge the two halves together.
You must do the following:
50% Read in the int array data from file specified by argv[1] (with appropriate error checking). The first num in the file defines how large the array should be. The remaining nums are the data (thus if N is the first num in the data file, then there should be N nums to follow it for a total of N+1 nums in the file)
75% Correct implementation of Multithreaded MergeSort procedure
100% Correct memory and handle management. Style plays a big part of this project, so spend time getting it all "cleanly" implemented.
CPP file which compiles and works as defined above.
(I'll use my own data file, so be sure to conform to the standard)
Any file that doesnt compile or
terminates ugly will receive no credit.
If you'd like 10% extra credit, do an O() analysis of your multithreaded MergeSort. Be sure to discuss theoretical upper bound with respect to thread overhead. Note that this extra credit is only possible if you correctly implement the algorithm.
Gain experience with bitwise operators
Waffle house claims to have over 844,739 (or 22,020,090 if you look at their PDF-version of their menu) ways to make "the finest hamburgers around." Your task is to model the burger information in as small a space as possible using bit-level data manipulation. First, construct a way of storing all of the various burger options at the bit level. Second, write a module that takes in a "burger info" variable and displays the information in an English format that a short-order cook could understand. Finally, in your main algorithm, generate 2000 burgers and validate that they are valid burgers (b/c depending upon how you write your program, it's possible to generate a non-valid burger).
Here are the burger options (as I see them):
Lettuce
Tomato, Grilled Tomato
Onion, Grilled Onion
Pickles
Chili
Bacon
Hot Sauce
Ketchup
Mustard, Spicy Mustard
Mayonnaise
Cheese
No bun, Toasted bun, Wheat bun, Grilled bun (type of bread)
Medium rare, Medium, Medium well, Well (how the meat is cooked)
Single, Double, Triple
Note that if you get a triple, each meat can be cooked different (i.e. you can get one patty medium, one well, and the other medium rare - or any combination of the above "cookedness"). Also, if you get more than one patty, you have the option of that many slices of cheese - so a double could have no, one, or two slices of cheese. Be careful to consider all the possibilities here!
You must do the following:
50% Define all of the needed bit-level constants and/or data structures to store the burger information
75% Write the PrintBurger module
100% Generate 2000 valid burgers and display them to the screen
CPP file which compiles and works as defined above.
You must use WebSubmit to submit this assignment
Any file that doesnt compile or
terminates ugly will receive no credit.
If you'd like 10% extra credit, describe exactly how many burger combinations there are in your solution. Tell me how you'd calculate this mathematically, and also tell me how you can determine this by looking at your program and the bit-level information. There should be a difference; explain why there is this difference between the mathematical calculated value and the bit-determined value.