EE-WEB Assignment 5
Program 1, 30pts.
Write an application that can also run as an applet and has the functionality of the impedance calculator.
- Layout: The calculator should have a title, four input textfields
(resistance in Ohms, inductance in Henrs, capacitance in Farads and frequency in
Hertz), one output text field (read only but not disabled) and three buttons:
parallel, serial and clear. The title should be larger and centered on a
separate line close to the top of the applet or application frame. Place all
other elements in the functional way.
- The application frame must be closable.
- Clicking the clear field should clear all text fields.
- Clicking the parallel button should calculate the absolute value of the
effective impedance of the three elements connected in parallel.
- Clicking the serial button should calculate the absolute value of the
effective impedance of the elements connected one after another.
See the suggested formulas but as a review
of the circuit theory class check for possible errors :-).
- Error handling: perform calculations only for positive input values and when
input values are valid decimal numbers. Display an appropriate descriptive error
message in the output field otherwise. If one of the elements is zero, then
assume that the said element is not present.
Your homework will be graded in the following way: The applet posted on your
Web site will be tested using several vaules. Not all of those values will be
numerically correct. Then the application sent by e-mail as a file attachment
will be compield using -deprecation option. The application will be resized to
check against correct layout, and then one saple calculation will be performed.
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. Please set the message subject to: web-hw5.
Thank you