2023fall223n-assignment2
2023fall223n-assignment2
Assignment 2
Prologue
This is the first program of this semester where something is moving in the UI. This is an
animation program.
Requirements
Make a program using C# that shows a ball object traveling on a rectangular race track. We
will call the path of motion a race track, but there is no race. There is only one moving object.
Baseline program: Initial view of the UI
Enter speed
Go (pixel/sec) Exit
This user interface shows 3 panels. The middle panel will be graphic enabled.
The title panel shows the name of the program and the name of the author.
The bottom panel has a Go button, and Enter speed label, a textbox for inputs, and an Exit
button.
The ball is in its starting position, the upper right corner of the race track.
The user is supposed to enter a speed float number into the textbox and then click on the Go
button.
If the user does not enter a speed into the textbox and clicks Go then a message is written to
the terminal window: “Please enter a speed value first”.
If the user does correctly input a speed number (type double) and then clicks on Go then the
ball moves counterclockwise along the track at the fixed speed input by the user.
The ball continues moving around the track until the user clicks on Exit.
When the user clicks on Go that button changes its label to “Pause”. If the user clicks on
Pause then the ball stops moving and the label changes to Go. This button is a toggle button
because it alternates between “Go” and “Pause”.
In this program we assume the user only enters good speed numbers of type double. We
assume the user does not enter anything invalid such as a negative number. In a future
assignment we will check for all the invalid inputs.
When the ball is moving it always keeps the center directly over the track.
Turning the corner is a difficult maneuver. The programmer must carefully program the turn.
Do not allow the ball to go past the turn point and short distance and then have to return to
the true corner. We want a nice smooth turn at each corner without changing speed.
Challenge program
To earn the 5 additional points the programmer must first make a program that satisfies all the
requirements of the baseline program.
Pick 4 distinct colors. That is choose 4 colors that a widely separated from each other in the
spectrum of colors.
When the ball is moving West its color is the first of your 4 colors.
When the ball is moving South its color is the second of your 4 colors.
When the ball is moving East its color is the third of your 4 colors.
When the ball is moving North its color is the fourth of your 4 colors.
General facts
To receive credit for any assignment the rule is that the program must run correctly on my
computer. The fact that it may run correctly on your computer is of absolutely no
significance.
The recommendation is the your build the program from the initial step to final test run all in
Linux.
If you are going to program in the newest wiz-bang invisible code obfuscator then before
sending the three files you should make one last test run in a Linux platform to be sure it will
run on my computer.
Make your UI big. The UI must cover at least 90% of the area of your monitor.
Submit your program
Due date: September 21, 2023 @ 2:00am [That is in the middle of the night.}
After you submit your program then get some sleep so that you will be awake when you log
on to zoom at 8:00am.
Remember the professor has a passion against links to programs in a cloud. Do not send
any links. Links will be discarded and never seen.
You must attach the 3 files of Assignment 2 to an email message and send the message to
[email protected] In the subject line put “223N Assignment 2” or something similar.
If you want to send me a message with your program the message should not be in the email.
Simply leave the message area blank.
To send me a message about your program or about your overloaded schedule put the
message in the comment area at the top of the main function.