-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathchap5assign.htm
More file actions
40 lines (38 loc) · 1.05 KB
/
chap5assign.htm
File metadata and controls
40 lines (38 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<!DOCTYPE>
<html>
<head>
<title>Chapter 5 Assignment</title>
<script type="text/javascript">
function calc_exchange(dollar, country)
{
ex_rate = dollar * country;
return ex_rate;
}
function lb()
{
document.write("<br>");
}
</script>
</head>
<body style="background-color:orange">
<script type="text/javascript">
var dollar_amt = prompt ("Please enter the amount of US dollars to convert");
var eur = .92310;
var gbp = .70152;
var aud = 1.41191;
var ars = 13.8800;
var thb = 35.6800;
document.write("$" +dollar_amt+ " in U.S. Currency is approximately equivalent to:");
lb();
document.write(calc_exchange(dollar_amt, eur).toFixed(2)+ " EUR (Euros)");
lb();
document.write(calc_exchange(dollar_amt, gbp).toFixed(2)+ " GBP (British Pounds)");
lb();
document.write(calc_exchange(dollar_amt, aud).toFixed(2)+ " AUD (Australian Dollars)");
lb();
document.write(calc_exchange(dollar_amt, ars).toFixed(2)+ " ARS (Argentine Pesos)");
lb();
document.write(calc_exchange(dollar_amt, thb).toFixed(2)+ " THB (Thai Bahts)");
</script>
</body>
</html>