Saturday, April 24, 2010

Assignment 13 - Simple Adder

LABAR Project 13
This assignment is to be done during your one hour lab by arrangement (LABAR). This assignment requires you to write your first javascript to declare, assign and display three variables of the string, number, and boolean types respectively.
In this assignment, Assignment #13, you are to create a simple addition only calculator as in the HTML Form below. This calculator can:
  • provide the addition and clear javascript functions;
  • provide two HTML text inputs for user to enter the two operaand numbers for addition function;
  • provide a HTML text input for the onClick triggered math function to place the result (number);
  • when add (+) operator button is pressed, i.e. the onClick event, the corresponding addition javascript function shall place the result in the Answer text Input;
  • when the Clear "C" button is pressed, i.e. the onClick event, all text Input fields shall be cleared.

Enter a number:
Enter a number:

Answer =

The above html form code is listed below:


Sample Code:
Javascript Adder

 

Try this adder out!

Simple Adder
Enter a number:
Enter a number:


Answer =

No comments:

Post a Comment

 

comsc-100 Copyright © 2009 Gadget Blog is Designed by Ipietoon Sponsored by Online Business Journal