You will create a Java program that displays a logo for something of your choice. It can be an organization, a product, a vehicle, etc. This program will give you practice with the Graphics class and if statements. In addition, you will get some initial experience creating your own methods. Have fun!
You will provide the code for multiple methods in the Logo class, including two helper methods that
you will create for use by your program
1. A user of your program should be greeted with a message dialog window (not on the console output window or an input dialog window)that introduces the program and asks the user to decide some details of the logo. The starter file shows an example of a similar exchange in which the user is asked how many trees to draw. Your program should ask something different. For example, you may ask if one of the items in the logo should be red or purple.
2. After the user has responded, your program should ask a second question about some other detail of the logo.
3. After receiving input from each of the dialog windows, the program should verify that the string entered by the user is a valid response. For example, if the user typed in “green” instead of “red” or “purple” in the example above, your program should display a dialog window message stating that the input was invalid, and the program is setting the value to a default value. For example, the program might say, “That is an invalid response. The default, 'red', will be used.”
4. Each time the user answers a question, you should save the user's response as an instance variable so that other methods in your program will be able to use it later. Recall that an instance variable is declared in the Logo class, but outside any of the methods.
Get Free Quote!
443 Experts Online