2023 Fall 223 Nmidterm
2023 Fall 223 Nmidterm
Make a program where the ball begins at the start of a slanted line, reaches a
corner, turns, and completes the trip at the end of the second slanted line.
The Ui looks like this.
Start Finish
The Pause Quit UI
1150 40 100 400 800 700
looks
like
Assignment 3. There are some differences. Here the user must input the
coordinates for 3 points, namely: start, corner and finish.
It is not important how you organize your control panel. You decide where you
want to place the input boxes for the new point. Wherever you choose is ok for
this midterm.
In assignment 2 you have to set new values for Δx and Δy whenever the ball
reached a corner. You will need to do the same thing here: give new values to Δx
and Δy when the ball center reaches the corner.
When the ball reaches the end of the second segment it simply stops and
execution is finished. It is time to click on quit.
End of requirements
Formulas
These formulas were given in a lecture. They are repeated here just in case you
need them.
Let the start point be A = (a1,a2); let the end point be B = (b1,b2).
Then
Δx = (b1-a1) * d / H
and
Δy = (b2-a2) * d / H
Last notes
The instructor hopes you are able to re-use your previous class assignments.
If your moving ball will not turn the corner then send me something interesting for
less points.
For example, you could send the ball always to the origin (0,0).
Another partial credit: when the ball reaches the end of the first slanted line send
it straight back to the starting point where it comes to a rest.
If your program will not perform according to the requirements on pages 1 & 2
then make it do something so that your gain some partial credit.
Due date
The due time is 10:00am. The same end time must apply to everyone. It would
be unfair if one individual were allowed to have more time than other students.
I accept multiple submissions. I will grade the newest of all your program
submissions.
If you wish to include a message to me with your source files, the best thing to do
is to include the message with the source files. Put the message as a comment at
the end of the driver source file.
I like to receive messages, but here is what happens. When I receive your
submitted files I separate the attachments from the email and save the
attachments in a folder with your name on the folder. When I grade your program
a few days later I usually don’t have Outlook open and I can no longer connect
your submitted program with the message in the email.