Creating A Calculator That Returns An Answer Using An If/else Statement?

Nov 5, 2010

I am trying to place a Body Mass Index Calculator on a web page. I need a prompt box that asks the user to enter their weight and height (in pounds and inches, respectively). The box should calculate BMI as follows:BMI = (Weight / (Height * Height) ) * 703;After the BMI is calculated, I would like the box to display the user's status (obese, overweight, normal, underweight). After the user has entered all information, use the document.write function to display the following, with the customized information:

Height
Weight
BMI
Status

View 3 Replies


ADVERTISEMENT

Make A Button To Display My Name In Answer Box Of My Calculator?

Oct 16, 2010

I need to make a button that will display my name in the answer box of my calculator.

Can anyone please show me the code to do this?code...

View 1 Replies View Related

Form Calculator With Financial Formatted Answer

Apr 14, 2009

I am working on a calculator page for a clients site. I am using dreamweaver and form calculator made by Kaosr as behavior / plugins in dreamweaver. The way I have it set up is first the user enters some numbers in boxes, clicks a get refund now button and a div element appears with the answer. The whole calculator works..but I cant get the answer to appear in currency format. I've found tons of applets for javascript that change it into currency format upon clicking a button or clicking elsewhere on the page.. but none that automatically will make a text box display currency when the answer appears..

View 1 Replies View Related

Calculator With If/then Statement?

May 26, 2010

I am working on a script that calculates the rental rate for a property. I currently have this code and form, which works as I wish it to.

Code:
<script type="text/javascript">
function roundCents(amount) {

[code]....

View 3 Replies View Related

Creating A Less Than Or More Than Calculator?

Dec 2, 2011

I have the last assignment that she wants us to do and I had to pull up another assignment that she wanted us to build upon( which is one of those coding without anything advance)

<html>
<head>
<title>

[code]....

now she wants us to do max <beta and then name the variables with if a<b and I don't know if I put that in the concatenation or what to name my variables!

View 18 Replies View Related

JQuery :: Jsonp (firebug)returns Missing ; Before Statement?

Mar 30, 2011

Here's my code:

$( document ).ready( function(){
$('#get_metars').click( function(){
//var icao = $('#icaos').val();

[code]....

View 1 Replies View Related

Creating A Monthly Mortgage Calculator

Oct 12, 2010

I am trying to create a monthly mortgage calculator, I have been able to make it show prompts for Amount of loan; Interest rate; and Term of loan (in months), but it will not display the results. Below is the code I have utilized to get this far.

[Code]....

View 1 Replies View Related

Creating Calculator - How To Execute Operators

Jul 18, 2010

We are required to create a javascript calculator. The page should has 3 text box, first and second text box would allow the user to input numbers, the third textbox will show the answer. the arithmetic operations should be in radio button, drop-down list and the select option. I'm still working on the radio button and i don't how to execute the operators. How to grab the inputted number from the textbox and how to execute the operators.

View 1 Replies View Related

Creating Calculator Using AppendDigit And Else If Functions?

Oct 20, 2010

I am new to Java and my teacher goes way too fast in class and am a day behind on this calculator. Our assignment is to make a Calculator using AppendDigit and Else if functions in the java code. Some of my other code in html may be messed up as well. I am just lost so here is the HTML:

Code:
<title>John's Calculator</title>
<style type="text/css">
.rt {text-align:right; font-family: Courier New;}
.numbttn {text-align: center; background-color:
silver; font-family: Courier New; width 4eM;}
body {background-color: silver} .....

And Here is the pathetic Javascript which I have barely started:
Code:
// cal Applet- John Falco- 20 October 2010
function clear TB() {
document.form.kpd.display.value="0";
}
function AppendDigit (x) {
if (x==".") {
if ((!HasDecimal))
}
else {
document.forms.kpd.display.value =
document.forms.kdp.display.value + X;
};

View 7 Replies View Related

Creating A Results Calculator -enter A Name Along With A Mark And Store In A Cookie ?

Apr 20, 2010

I am basically trying to enter a name along with a mark and store this in a javascript cookie. From this I want to create the mean and graph for up to 100 results.This is the code:

<html>
<head>
<title>Class Marks Calculator</title>[code]....

I have been working on this for hours and do not understand where I am going wrong.

View 5 Replies View Related

Creating That Has Both A Lightbox Rel Link And A Quick Calculator To Work Out A Size Of A Product?

Dec 22, 2010

I have a page on a website I am creating that has both a lightbox rel link and a quick calculator to work out a size of a product.Here are the links to the java files I am using:

<link rel="stylesheet" href="css/style.css" type="text/css" media="all" />
<link rel="stylesheet" href="css/jquery.lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="scripts/jquery.js"></script>

[code].....

View 1 Replies View Related

Creating Array From Prompt - Function Multiply Returns?

May 11, 2011

<script>
// Declared Constants
MORSE_ALPHABET = new Array (
'.-', // A
'-...', // B
'-.-.', // C
'-..', // D
'.', // E
'..-.', // F
'--.', // G
'....', // H
'..', // I
'.---', // J
'-.-', // K
'.-..', // L
'--', // M
'-.', // N
'---', // O
'.--.', // P
'--.-', // Q
'.-.', // R
'...', // S
'-', // T
'..-', // U
'...-', // V
'.--', // W
'-..-', // X
'-.--', // Y
'--..' // Z
);
CHAR_CODE_A = 65;
var CTS = prompt('Enter Morse code','here')
var inMessage = CTS.split(' ');
searchLocation(inMessage,MORSE_ALPHABET)
function searchLocation(targetValue, arrayToSearchIn) {
var searchIndex = 0; // Iterative counter
for(i=0;i < targetValue.length;) {
targetValue = targetValue[i];
// Search until found or end of array
while( searchIndex<arrayToSearchIn.length && i != targetValue.length &&
arrayToSearchIn[searchIndex]!=targetValue) {
i++searchIndex++;
} if(searchIndex<arrayToSearchIn.length) {
return String.fromCharCode(CHAR_CODE_A + searchIndex);
} else {
return -1;
}}}
document.writeln(searchLocation(inMessage,MORSE_ALPHABET));
</script><head></head><body></body>

This is my code and I have figured it to create an array from the prompt and then use the function to return the first array it finds but I cant seem to make it go on to the next index of the array. I know that when you return a value the function closes and I have tried to store my return in a variable but its not working the way I want it to or I'm not writing the correct command or is there away to do multiply returns, I think what I need to do is simply but I have been staring at this screen for a while now and just cant see it.

View 3 Replies View Related

Creating Code With If...else If...else Statement?

Nov 27, 2011

I am thinking of how to write the code for below scenario to create a simple online customize calculator:There is 1 box which allow us to enter any number=x (representing amount of money). So whenever we entered a number in the box and click "CALCULATE" buton below the box,there will be 3 results generated in 3 boxes below it based on the set of of rules i.e.

1. if the amount entered is <21,000

Result 1 = 1.5%*x*12
Result 2 = 1.5%*x*48
Result 3 = 1.5%*x*120

2. if the amount entered is >=21,000 and <210,000

Result 1 = 1.8%*x*12
Result 2 = 1.8%*x*48
Result 3 = 1.8%*x*120

3. if the amount entered is >=210,000

Result 1 = 2.2%*x*12
Result 2 = 2.2%*x*48
Result 3 = 2.2%*x*120

I understand that this code will involve If...else if...else Statement..

View 7 Replies View Related

Creating Textbox That Uses If Statement

Sep 9, 2010

I'm trying to create a textbox that uses an if statement. If the words vgn, vgx, vgc, pcv, pcg are typed into the textbox it will input a "-" in front of those letters in the textbox , "else" it will input nothing.
i.e:
Input: vgn
Output: vgn-

View 4 Replies View Related

Creating A Switch Statement That Tests The Value Of The PartyType Parameter

Nov 14, 2009

Im creating a switch statement for this case, but dont know how to start - Create a Switch statement that tests the value of the partyType parameter. If partyType equals "D", store the following text string in a variable named barText: <td class='dem'> </td>

If partyType equals "R", barText should equal <td class='rep'> </td> etc.. So since its going to test the value of the partyType parameter, and store the text string in a variable named barText do i begin like:

[Code]...

View 4 Replies View Related

JQuery :: Validate: Regex That Returns True Elsewhere Returns False Inside Validator Method

Oct 8, 2009

Either I'm having a really dim Friday, or something strange is going on. I'm trying to add a method to the Validator plugin, using the following regex:

[Code]....

View 1 Replies View Related

If Statement Returning False On A True Statement?

Apr 4, 2011

my webstie allows users to change the color of the background, so to keep the text readable I have it changing as well.the color picker I am using has text boxes with rgb values 0-255 for each.I am trying to get one bit of text to alternate between red and blue with the conditions

Code:
if(blue>green && blue>red)
{

[code]....

View 2 Replies View Related

Need To Alert Right Answer

Nov 1, 2011

I need to alert the answer 31 but keep getting 34. It has to go like this ticket*reward+cost. It would be 24+4+3=31. I would need to times the tickets by rewards then add the cost after. How would I alert this? code...

View 3 Replies View Related

Hide The Check Box Answer?

May 26, 2009

when I click the check box the answer appears. When i click of it, it does not disappear....

<IMG src="/ukassets/images/75/CM%20new%20template/index_r2_c1.jpg" border=0>
<style type="text/css">
#container {

[code]...

View 3 Replies View Related

Can't Get My Answer To Display / Why I Sthis?

Mar 25, 2011

I am obviously new to Javascript, etc me by pointing out what is wrong with my code while changing as little as possible ... and if you could also please explain the part that says code...

as I copied that portion from someone and I really don't understand it. code...

View 7 Replies View Related

Need DHTML Answer ASAP

Aug 13, 2010

what is the function of code...

View 2 Replies View Related

Cancel Answer Still Submits / What To Fix It?

Dec 9, 2010

I have created a checkDelete function to ask the user if he wants to delete the selected entries from a database. The problem is that choosing cancel still deletes those entries.
This is the function code...

View 9 Replies View Related

Answer Not Displayed In Field

Aug 13, 2009

m just a beginner in java scripting.I just made the following code for calculating the factorial of a number [code] however when i try to run it the result is not displayed in the field.

View 2 Replies View Related

Radio Button To Text Answer?

Mar 28, 2009

Radio button to text answer

View 2 Replies View Related

Get Automatic E-mail Answer Script?

May 1, 2009

I already found some cool stuff here, but I'm looking for a script that, if somebody send me a e-mail, he/she automaticaly receive a reply from me, including a required access code.

View 3 Replies View Related

Code To Question And Answer For Website?

Feb 6, 2010

I need a java script code that it allow users to post their questions and I can answer them .

How can I do so ?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved