13.3 |
Extend the program in Fig. 13.26 to include a CheckBox for every font-style option. [Hint: Use logical exclusive OR (^) rather than testing for every bit explicitly.]
|
13.4 |
Create the GUI in Fig. 13.41 (you do not have to provide functionality).
Figure 13.41. Calculator GUI.
|
13.5 |
Create the GUI in Fig. 13.42 (you do not have to provide functionality).
Figure 13.42. Printer GUI.
|
|
|
13.6 |
Write a temperature conversion program that converts from Fahrenheit to Celsius. The Fahrenheit temperature should be entered from the keyboard (via a TextBox). A Label should be used to display the converted temperature. Use the following formula for the conversion:
Celsius = ( 5 / 9 ) x ( Fahrenheit 32 )
|
13.7 |
Extend the program of Fig. 13.38 to include options for changing the size and color of the lines drawn. Create a GUI similar to Fig. 13.43. The user should be able to draw on the application's Panel. To retrieve a Graphics object for drawing, call method panelName.CreateGraphics(), substituting in the name of your Panel.
Figure 13.43. Drawing Panel GUI.
|
13.8 |
Write a program that plays "guess the number" as follows: Your program chooses the number to be guessed by selecting an int 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.
A TextBox 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 Label should display either "Too High" or "Too Low," to help the user zero in on the correct answer. When the user guesses the correct answer, display "Correct!" in a message box, change the Form's background color to green and disable the TextBox. Recall that a TextBox (like other controls) can be disabled by setting the control's Enabled property to false. Provide a Button that allows the user to play the game again. When the Button is clicked, generate a new random number, change the background to the default color and enable the TextBox.
|
13.9 |
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. TextBoxes for inputting the order number, the customer name and the shipping address are provided. Initially, these fields contain text that describes their purpose. Provide CheckBoxes for selecting the fuzzy-dice color and TextBoxes for inputting the quantities of fuzzy dice to order. The application should update the total cost, tax and shipping when the user changes any one of the three Quantity fields' values. The application should also contain a Button 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.
|