
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

CIS 4930-4 Component-Level Programming EMA 100 Program #7 Roll The Dice 20 Points
Construct an ActiveX control for rolling six-sided dice. Each instance of the control will represent one cube. The faces of the cube look like this.
The bounding rectangle is required. On the cube, the two opposing sides always add up to 7, so 1 is opposite 6, 3 is opposite 4, and 5 is opposite 2. When 1 is on top and 2 is in front, three is to the right. (Some dice may be mirror images of this.) When you draw your control, you draw only the top face of the die.
Your control must have the following properties. TopFace โ Read Only, gives the number currently showing in the control. BottomFace, LeftFace, RightFace, FrontFace, BackFace โ Self explanatory.
Your control must have the following methods. RollLeft( ) โ Rolls the die so the right face appears on top, the top becomes the left, etc. Front and back do not change. RollRight( ) โ Opposite of RollLeft( ). RollForward( ) โ Rolls the die so the back becomes the top, the top becomes the front, and so forth. Left and right do not change. RollBackward( ) โ Opposite of RollForward( ). Toss( ) โ Top and Front faces are selected at random. Top and Front selection must be consistent, Other faces must be set accordingly. Set(long Top,long Front) โ Sets the die to a known position. Top and Front must be from 1-6, and Top and Front must be consistent with one another. The other sides will be set accordingly.
Your control must have the following event. Click โ No Parameters. Fired whenever the left mouse button is clicked anywhere in the control window.