EE-WBC Assignment 8

Program 1 (40pts.)

Write a program in Java that can be run both as an application and as an applet that implement a base conversion calculator. The program should have two text fields, two choice lists and a clear button. Editing a number in one of the two text fields should result in immediate calculation of the number in another text field. No pressing of any button should be necessary. The base (radix) for each text field should be read from the choice list. Changing the unit choice should result in recalculating the value of the corresponding text field. At least the following bases should be available: 2, 8, 10, 16.

The program should signal which field is a valid input, invalid output, valid output, or invalid output by changing the background to green, red, yellow, or cyan. Pressing the clear button should preset values and colors of all text fields and choices to an initial condition.

Please observe the functionality of the following applet. Your program does not have to look the same but it should respond the same way to user by changing both text and color of its GUI. You may use Swing instead of AWT if desired but it must work both for application and applet.

Sample Solution

A sample solution to this homework will be posted soon after it is due to allow better preparation for the upcoming exam. Please make sure that you submit your work on time. After a sample solution is distributed homework will not be accepted.

Homework Submission

Attach all source code in files with proper names and extensions (*.html, *.java, *.pl, *.php, .htaccess e.t.c.). Do not ZIP files together or include compiled files (e.g. *.class). In case of dynamic Web pages (JavaScript or CGI) or Java applets also send the complete URL (including http://) that points to a page on your Web site that demonstrates your homework. Send your homework via e- mail to the instructor at olekmali at bradley dot edu. Please set the message subject to: web-hw8.

Thank you.

web site front local main page local list page print this page   general bookmarks software bookmarks go back close this page copyright info   visitor counter