Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Modify the Lab3a Java application program to use a windowing interface for the input request and for displaying the results. As in Lab 3a, the

image text in transcribed
image text in transcribed
Modify the Lab3a Java application program to use a windowing interface for the input request and for displaying the results. As in Lab 3a, the program should ask the user to enter an integer value for degrees in Fahrenheit; convert the number to the equivalent Celsius temperature, including the fractional part to at least one decimal point; and display the converted value. However, the program should import and use JOptionPane methods to allow input and message(output) dialog boxes. Be sure to include the proper exit command to end the program. Formula: C = 5(F-32)/9 To Round to 1 decimal place: to 2 decimal places: double X; X = Math.round(x * 10) / 10.0; X = Math.round(x * 100) / 100.0; Sample program execution: Input ? Please enter a temperature in degrees Fahrenheit 72 OK Cancel Message X 72 degrees Fahrenheit is 22.2 degrees Celsius OK Modify the Snowman applet that was created in Lab 2. (Note: You can add the applet to the existing project for the Labz applet, or create a new project.) The modification wii add color to the snowman Some of the color will be based on the user's selection via an Input dialog box Add the appropriate import statements at the beginning of the applet. Using an input dialog box, ask the user to enter one of three colors: Orange, Pink, or Yellow Using an appropriate string comparison method determine which color was entered (capitalization should not matter and set the graphic pen color accordingly. If the user enters an Invalid selection, use a show message dialog box to indicate their mistake and set the color to WHITE Snowman color instructions: Draw 3 filed circles in the selected color, one above the other. Draw 3 cicles in BLACK to outline the filled circles Put a face in the top circle with filled circular eyes and nose and an arching smile Color the eyes BLUE, nose MAGENTA, and mouth RED. Add 3 coa buttons to the middle circle with straight line arms coming out each side. The buttons and arms should be BLACK After displaying the Snowman, display a show message dialog box asking the user to click OK to ext. This will pouse the Appletviewer until the user is done viewing the graphics Include a system exit command to properly end the process Test your code using the Appletviewer. (Note: to enlarge the Appletviewer ste, enter the following directly after starting the paint" method: sete400,6001: Sample using Appletviewer 7 Sure that is com OK

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Making Databases Work The Pragmatic Wisdom Of Michael Stonebraker

Authors: Michael L. Brodie

1st Edition

1947487167, 978-1947487161

More Books

Students also viewed these Databases questions

Question

How wide are Salary Structure Ranges?

Answered: 1 week ago