C++ Programming HW14 Speaker : Ching-Chen Chang Date: 2008/05/23
Assignment 1 Write an SDI application which draws rectangles with different hatching styles as follows. You should use a for-loop to draw the rectangles.
Assignment 1 (Cont.)
In WinDGI.h /* Hatch Styles */ #define HS_HORIZONTAL 0 /* */ #define HS_VERTICAL 1 /* ||||| */ #define HS_FDIAGONAL 2 /* \\\\\ */ #define HS_BDIAGONAL 3 /* ///// */ #define HS_CROSS 4 /* */ #define HS_DIAGCROSS 5 /* xxxxx */
Assignment 2 Each dice has face values 1, 2, 3, 4, 5, 6 and the probability that face with value 1 will be on top is 1/6. Assume the probability of each value to be on top is the same. When you throw two dices, the summation of the top two faces will be within the range (inclusive) But their probability is not equally likely or 1/12. The probability that the sum will be two is 1/36, but the probability that some will be three is 2/36 and so on.
Assignment 2 (Cont.) Let N denote the number of throws. Write an SDI application to simulate the occurrence of each value within the range when N = 100. Store the occurrence of all values in an integer array, and draw a bar chart showing their heights which is proportional to the number of their occurrence. The usage of random number generator was introduced in HW 9 in last semester.HW 9 A sample output is shown as below. You may click the "New Document" button in the toolbar to generate new simulation.
Assignment 2 (Cont.)
Note Deadline:2008/5/23 10:00 AM Upload to the following link Project Name e.g. HW14_ Compress the folder to a ZIP or RAR file
Demo , , , , , , , , , , , Demonstrate their programs to Prof. Wu.