Write a C# program that displays a GUI window with two buttons: A “Deal” button and a “Sort” button. Every time the user clicks on the “Deal” button, a new playing card is added to the screen (Just like the blackjack assignment).

engineering

Description

Question 1 [10 marks]:Write a C# program that displays a GUI window with two buttons: A “Deal” button and a “Sort” button. Every time the user clicks on the “Deal” button, a new playing card is added to the screen (Just like the blackjack assignment). Every time the user clicks on the “Sort” button, the program will rearrange all the card from low to high (Ignoring suit).

 

 

Question 2 [10 marks]:Write a C# program that allows the user to draw and animate shapes on the screen (similar to the one we worked on together in class). Your program must

a)      [2 marks] Allow the user to select the color by clicking on either “Red”, “Blue” or “Yellow” button.

b)      [4 marks] Allow the user to draw three different shapes: Circles, Rectangles, Triangle.

If the user wants to draw a Circle, he or she will:

a.       Click on a button called “Circle”, then

b.      Click anywhere on the screen to specify the center point

c.       Click anywhere on the screen again to specify the circle rim

If the user wants to draw a Rectangle, he or she will:

a.       Click on a button called “Rectangle”, then

b.      Click anywhere on the screen to specify the top left corner

c.       Click anywhere on the screen again to specify the bottom right corner

If the user wants to draw a Triangle, he or she will:

a.       Click on a button called “Triangle”, then

b.      Click anywhere on the screen to specify the first corner

c.       Click anywhere on the screen again to specify the second corner

d.      Click anywhere on the screen the third time to specify the third corner

 

 

c)       [4 marks] Ensure the that drawn shapes do not fall off the screen. That is, when a shape touches the floor, ceiling, or side walls, they must change direction to avoid falling off the screen.

 

Feel free to reuse any of the code we wrote in class or in your own  previous assignments (Must be your own code) for both questions.

 

 


Related Questions in engineering category