could someone please shed some light on this i cant get to grips with java at all.
i need to make the following code convert euros to dollars and vice versa 1 euro = 1.26 dollars and vice versa i cannot make it convert the currency at all i think im going mad please help if you can.
i would imagine its easy i just need pointing in the right direction cant figure out if i need to use an array basically the user needs to select a currency either 0 for Euros or 1 for dollars and then enter a value then convert for relevant currency any help would be greatly appreciated.
<html>
<head> M 150 TMAO3 Question 1
<title>Enter a currency</title>
<script language="JavaScript" >
var currencyType;
currencyType = 0;
var amountEntered;
amountEntered = 0;
var amountConverted;
amountConverted = 0;
currencyType = window.prompt('Please enter the currency) Dollar 1) Euro 0','');
currencyType = parseFloat(currencyType);
while (currencyType <= -1 || currencyType >= 2)
{
currencyType = window.prompt('Please re-enter - currency should be 0 or 1', '');
currencyType = parseFloat(currencyType);
};
amountEntered = window.prompt('Please enter the amount to be converted','');
amountEntered = parseFloat(amountEntered);
if (currencyType = 1)
amountCoverted = 1 * 12.27;
document.write('<BR>' + amountEntered + ' of type ' + currencyType + ' is ... ' + amountConverted + ' <BR> ')
</script>
</head>
<body>
</body>
</html>


