Extend the program in Fig. 13.26 to include a
for every font-style option. [
Use logical exclusive OR (
) rather than testing for every bit explicitly.]
Create the GUI in Fig. 13.41 (you do not have to provide functionality).
Figure 13.41. Calculator GUI.
Create the GUI in Fig. 13.42 (you do not have to provide functionality).
Figure 13.42. Printer GUI.
Write a temperature conversion program that converts from Fahrenheit to Celsius. The Fahrenheit temperature should be entered from the keyboard (via a
should be used to display the converted temperature. Use the following formula for the conversion:
Celsius = (
5 / 9 ) x (
Extend the program of Fig. 13.38 to include options for changing the
of the lines drawn. Create a GUI similar to Fig. 13.43. The
should be able to draw on the application's
. To retrieve a
object for drawing, call method
, substituting in the
Figure 13.43. Drawing Panel GUI.
Write a program that plays "guess the number" as
: Your program chooses the number to be guessed by selecting an
at random in the range 11000. The program then displays the following text in a label:
I have a number between 1 and 1000--can you guess my number?
Please enter your first guess.
should be used to input the guess. As each guess is input, the background color should change to red or blue. Red indicates that the user is getting "warmer," blue that the user is getting "colder." A
should display either "
" or "
," to help the user zero in on the correct answer. When the user guesses the correct answer, display "
" in a message box, change the
's background color to green and disable the
. Recall that a
(like other controls) can be disabled by setting the control's
. Provide a
that allows the user to play the game again. When the
is clicked, generate a new random number, change the background to the default color and enable the
Write an application that allows users to process orders for fuzzy dice. The application should calculate the total price of the order, including tax and shipping.
es for inputting the order number, the customer name and the shipping address are provided. Initially, these fields contain text that describes their purpose. Provide
es for selecting the fuzzy-dice color and
es for inputting the
of fuzzy dice to order. The application should update the total cost, tax and shipping when the user changes any one of the three
fields' values. The application should also contain a
that when clicked, returns all fields to their original values. Use 5% for the tax rate. Shipping charges are $1.50 for up to 20 pairs of dice. If more than 20 pairs of dice are ordered, shipping is free. All fields must be filled out at the top, and an item must be checked for the user to enter a quantity for that item.