CS113
Project #1
SUBMARINE MOVING UNDER THE SEA
Design a submarine or underwater vehicle of your choice that can move under the surface of the ocean, sea, lake or river. Use controls of your choice form the following set (label, textbox, shape, line). Each part of the vehicle should have meaningful name such as Tail, LeftWindow, RightWindow e.t.c.
Have four command buttons to allow user to remotely control the direction of submarine movement. The control buttons should be positioned the same way as the arrow keys on the keyboard. The captions on the four buttons should be UP, DOWN, LEFT and RIGHT.
When application is running and user presses “LEFT” button, the submarine should move left 100 units. By pressing and releasing the “LEFT” button repeatedly, the user should make submarine move additional 100 units after each click. ( Click means press + release left mouse button while cursor is over the command button showing caption “LEFT”). The work or other command buttons should be analogous.
Project #2
When P dollars are deposited in a savings account at interest rate r compounded annually, the balance after n years is P(1+r)n. Write a program to request the principal P and the interest rate r as input, and compute the balance after 10 years. Sample output is shown on the left picture on page 135.
Project #3
Write a program using the form in Figure 5.10 on page 253. Each time the command button is pressed, RND function is used to simulate a coin toss and the values are updated. The figure shows the status after 35 tosses. (HINT: you can produce tosses quickly by just holding down the ENTER key. At the beginning the percentage will fluctuate but after many tosses (more than 1000) it should stay close to 50%.