<!doctype html>
<html>
<head>
<meta charset="UTF-8">
<title>Exchange rate</title>
<link rel="stylesheet"type="text/css"href="exstyle.css"/>
</head>
<body>
<script type="text/javascript">
d=35;
e=40;
x=prompt("Insert Value");
var z=x/d,
g=x/e;
var currency;
currency=prompt("Insert Country");
if(currency="dollar"){
document.write(+z);
}
else
if(currency="euro"){
document.write(+g);
}
</script>
</body>
</html>
I have encountered an issue while attempting to execute the code. For instance, when I input a value of 4000 for x and choose dollar as the currency, I receive the correct result of 114.28. However, upon selecting euro as the currency, the output remains the same as when dollar was chosen. Could there be an error in my implementation?