New Perspectives Classic Labs
VISUAL PROGRAMMING
In the Visual Programming Lab, you use an event-driven,
object-oriented programming environment to create simple programs. This
Lab provides a "taste" of what it would be like to program in
a visual language such as Visual Basic.
1. Click the Steps button to learn how to create a graphical
user interface containing buttons, labels, and text boxes. As you work
through the Steps, answer all of the Quick Check questions. After you
complete the Steps, you will see a Quick Check Summary Report of your
answers. Follow the directions on the screen to print this report.
2. In Explore, create a program to calculate the total cost
of carpeting a room. Test your program, then print it showing the cost
of $12.99/sq. yd. carpeting for a 10 x 14 foot room.
Assume that the room is rectangular. The known information is
the length and width of the room, and the price of a square yard of
carpet. You must calculate:
the square feet of carpet needed (length * width of room)
the square yards of carpet needed (square feet/9)
total price of carpet (Price
per square yard * the square yards needed)
3. Suppose
you like to shop from catalogs. Your favorite catalog is having a
sale-selected merchandise is discounted 10%, 20%, 30%, or 40%.You want
to know how much you'll save if you buy some of the merchandise you
want. In Explore, create a program to calculate savings. Test your
program, then print it showing the savings for a $863 item at 30%
discount.
Assume that the items you purchase will be discounted and
that there is no additional charge for shipping. The known information
is the original price of the item and its discount-10%, 20%, 30% or 40%.Calculate how much you will
save. (For example, for a 10% discount,
multiply the original cost by . 1. )
4. In
your recording studio, studio musicians are paid by the hour, but your
sound technicians are salaried. You started to make a program to
calculate weekly paychecks, but it doesn't seem to work.
Your assumption is that some employees are salaried and some
are hourly. You know the salaries for salaried employees. You know the
hourly wage and the hours worked each pay period by the hourly
employees. You want to calculate the weekly pay for salaried employees
(Wages / 52) and the weekly pay for hourly employees (Wages * Hours).
5. In
Explore, open the program PAY. VPG and test it. Enter 32240 in the Wages
box, then click the Salaried button. The output should be 620.Next
enter 8 in the Wages box and 40 in the Hours box. Click the Hourly
button. The output should be
320.Find what's wrong with this program
and correct it. Print your solution.