Help need

profilehad0060
assignment.pdf

Create a java project named and files named UserInterface.java and Calculate.java

Specific Instructions

Recent problems in the client billing system at Wrigle Inc. have prompted Jake,

the IT Manager, to assign you the task of prototyping a new user interface for the

billing system. Jake would like to you to develop the interface and related

processes as follows.

1. Create a UserInterface class and a Calculate class as 2 separate classes. 2. Look at the interface on the next page. 3. The interface should allow the user to first enter the number of “Bills to Process”

a. Prior to the user entering the # of Bills To Process, all of the other buttons and textfields should be disabled (.setEnable()) and the background colors in the textfields should be gray to show the user they are not active.

b. Once the user enters a number of bills to process, enable the rest of the interface and disable the “Enter” button and set the background color of the textfield next to “Enter # of Bills to Process” to gray to show the user that it is disabled.

c. USE THE NUMBER ENTERED BY THE USER TO CREATE THE NUMBER OF ROWS FOR AN ARRAY THAT HAS 3 COLUMNS.

4. After the user enters a number for # of Hours Billed and the Process! button is click, through the actionPerformed method, CALL A METHOD NAME ProcessData() that will take the data from the textfield for # of Hours Billed and convert it to a float variable named fltHours and PLACE IT IN THE APPROPRIATE CELL IN THE ZERO COLUMN OF THE ARRAY. Then use an IF statement and the getState() to determine which of the radio buttons was select (Staff, Manager, Partner). If the Staff radio button was selected assign the global variable intRank the value of 1, if the Manager radio was selected, assign intRank = 2 and finally of the Partner radio button was clicked, assign intRank = 3. Finally, send the value of fltHours and the value of intRank to the Calculate class USING A CONSTRUCTOR.

5. Once the data is sent to the Calculate class, make it available for other methods in the Calculate class to access by assigning each value to a global variable.

6. In the Calculate class, build a method named AssignRate(). In the AssignRate Method, use an IF or a Switch statement (YOUR CHOICE) to determine, based on the int value of intRank that was sent to the constructor, what the value of the GLOBAL variable NAMED FLTRATE should be. So, if intRank = 1 then FLTRATE = 100, if intRank = 2 then FLTRATE = 200, if intRank = 3 then FLTRATE = 300

7. In the Calculate class, create a method named ProcessHours() that will return a float data type. Build this method so that it will multiple the hours billed entered by the user times the rate for the level (Staff, Manager, Partner) as described above.

8. Create a method in the Calculate class named getRate(). Build it so it can return a FLOAT value. 9. In the ProcessData() that you create, make sure you include a call to the ProcessHours() and the

getRate() methods in the Calculate class. Each of these calls will return float values –

ProcessHours() will send back the total bill (Hours * Rate) and getRate() will send back the float value rate that was assigned by the selection of one of the radio buttons.

10. Once you get the two float values back from the Calculate class, assign the rate value to the appropriate cell of the global array in the second column. Also, assign the value that represents the total billed to the third column of the array.

11. Once the number of bills that the user entered to process has been reached, use a for loop to display all of the data from the array in a textarea.

Staff Manager Partner

Process!

# Hours Billed

TextArea

Enter # of Bills to Process

Enter