Question: (b) Write a class Conversion containing the following methods: (i) constructor: which builds the frame shown on the right side. The frame consists of a
(b) Write a class Conversion containing the following methods: (i) constructor: which builds the frame shown on the right side. The frame consists of a text field for inputting a NZD amount, a label with 10 spaces for an equivalent HKD amount, and a button to start the calculation. Declare any necessary attributes in the class and add appropriate action listeners for future use. Copy the class, including import statement(s), as the answers to this part Calculate (ii) actionPerformed : which performs the calculation and puts the result on the label when the button is pressed. You can assume one NZD is equivalent to 5.5 HKD. You can assume a valid realnumber1234 is entered in the textfield. Copy the method as the answers to this part 67.87 Calculate (iii) mainO which creates a Conversion object and sets it visible for testing. Copy the method as 120 the answers to this part
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
