Write a GUI program that runs both as an application and applet. The program should work as Weightwatchers' "Point" Calculator, i.e. for given number of kilocalories (textfield), grams of fat (textfield) and grams of fiber (textfield) it should calculate and display (read only text field or label) the number of equivalent points. Design a functional layout for the GUI. The layout should be either resizable, or alternatively disable frame resizing.
The program GUI should have no buttons. Each time contents of an input text field changes, the points should be recalculated. An empty text field input should be considered as 0. If a textfield content cannot be translated into positive number, then its backgound should be set to pink, and reset to regular color only after an error is corrected.
The formula to be used is: points = kcal/50.0 +
g_Fat/12.0 - min(g_fibeR,4)/5.0. Display the result
rounded to 0.1 or to 1 (checkbox checked or unchecked).
Please note that WeightWatchers program and Points are patented (U.S. Patent number 6040531) and protected by copyright. WEIGHT WATCHERS and POINTS are the registered trademarks of Weight Watchers International, Inc. After the assignment is graded you may have to remove the program from your Web site.
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 cegt201.bradley.edu. Please set the message subject to: web-hw8.
Thank you.