Answer to Question #47676 in AJAX | JavaScript | HTML | PHP for john

Question #47676
I am trying to get a temperature conversion caculator to work for me and I seem to be having a confusing problem. The html code below is what I'm needing to follow by.
<!DOCTYPE html>
<html>
<head>
<title>Temperature Converter</title>
</head>
<body>
<p>Enter a Temperature to Convert in the field below and select the starting scale.</p>
<input type="text" name="txtTemp" id="txtTemp" placeholder="Enter a Temperature" />
<br />
<br />
<input type="radio" id="radFahrenheit" name="radTemp" checked/>Fahrenheit to Celcius




<input type="radio" id="radCelcius" name="radTemp"/>Celcius to Fahrenheit








<button onclick="ConvertTemp();">Convert</button>





<div id="divResults"></div>
<script type="text/javascript" src="Week7.js"></script>
</body>
</html>

And with the javascript part I've gotten this so far also I'm not use to if and else statements yet.

function ConvertTemp(){
var radFahrenheit = parsefloat(document.getElementById('radFahrenheit').value);
var radCelcius = parsefloat(document.getElementById('radCelcius').value);
var txtTemp = document.getElementById('txtTemp');

if(radF.checked){
radFahrenheit = (radCelcius * (9/5)) + 32;
FahrenheitToCelcius();
}else if(radC.checked){
radCelcius = (radFahrenheit -32) * (5 / 9)
CelciustoFahrenheit();
}
}
1
Expert's answer
2014-10-10T02:03:32-0400
The answer to the question is available in the PDF file https://www.assignmentexpert.com/https://www.assignmentexpert.com/homework-answers/programming-answer-47676.pdf

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
APPROVED BY CLIENTS