|
The programs you are required to write are
described below. They are also described on the written test for
your convenience. For each programming question you answer please
zip up your complete project folder including all source code,
project, and solution files. Then, rename the zip file to:
MidW2009-Q1.zip where Q1 is for question 1, MidW2009-Q2.zip where Q2 is for question 2, and so
forth. Finally, place the zipped file for each question you answer
in your folder on the FTP site. The date/time of the zip file will
be used to determine when you handed it in.
I will use the same grading procedures I have used
on previous programs (this includes looking at properly named classes,
variables, and files; as well as checking for comments in your code).
Important: Partial credit will be given.
If you can't quite figure something out, leave the code in your program
commented out so I can see where you were going and how close you got.
However, make sure the program you hand in is syntactically correct,
will compile, and
will run.
Please answer 2 of the following
three questions (50 points each):
NOTE: You can only receive credit for two questions. If you
answer all three, I will only grade the first two.
Question 1
Write a small program that accepts a username and a
password and uses a conditional statement to validate the user.
You should design one form that has two labels titled "Username:" and
"Password:" associated with two text boxes. The text box
associated with the "Password:" label should not display the password as
clear text as you type. You should also have a button on your form
titled "Login". When the button is clicked, check to see if the
username is "CHum220" and the password is "CoolClass". If so,
display a message box that says "Access Granted!", otherwise display a
message box that says "Access Denied!"
Question 2
Write a small
program that will display a circle that “bounces” around the client area
of the main form. You must use a timer, the form’s paint event, and a
system.drawing.graphics object to move and draw the circle. The circle
must be animated so that it moves across the client area (both
vertically and horizontally). When the circle reaches the edge of the
client area it should “bounce” off the edge by changing its direction.
Question 3
Make a program that has a form with a single button
titled "Create". Each time that button is clicked it should create and show
a new "modeless" form. With each new form displayed, change the
location of the form, set its title to be a sequentially incrementing
number, and set it's background to a random color.
Please answer the following
question (100 points):
Question 4
You are to write a rock-paper-scissors game that
one person can play against the computer. Your game should consist
of a main form and an about form. Create a menu on the main form
that has a menu item to start a "New Game", an item to show the "About"
box, and a menu item to "Exit" the program. When the "New Game"
menu item is selected, a message box should appear confirming the
request. If accepted, all statistics for the current game should
be cleared.
If you are unfamiliar with rock-paper-scissors here
are the simple rules. Two people play by simultaneously selecting
one of the three objects: rock, paper, or scissors. A person
"wins" by selecting an object that "beats" the other: Paper beats rock,
rock beats scissors, and scissors beats paper. If the two people
pick the same object it is considered a draw.
Your form should have a combo box, or list box, or
set of three radio buttons which will allow the human player to select
either "Rock", "Paper" or "Scissors". It should also have a button
titled "Go" and have at least three label controls which will contain a
running tally of computer wins, human player wins, and draws. The
human player should select "Rock", "Paper", or "Scissors" and click the
"Go" button. At which point you should randomly select an opposing
"Rock", "Paper", or "Scissors" for the computer player. Display
pictures of the objects that the human and computer selected and show a
message in a label on the form about who won, or whether it was a draw.
Add a point to the appropriate tally label control.
Also, if the computer wins, play a sound file that
reflects the "crowd's" disappointment. If the player wins, play a
sound that reflects the "crowd's" excitement. If it is a draw,
then play no sound, unless you have had two draws in a row. Then
play a sound that reflects the "crowd's" boredom. These sounds can
be anything you wish. Be creative.
Pictures to display can be found
here. You
are welcome to use your own. |