This is a currency conversion program created by me, done in JS. During math class, while learning about conversions, we were supposed to use code.org to create a program similar to this one. Although, due to my lack of knowledge of code.org, and my familiarity with JS, I created it in JS instead. Also, this was done by hard coding, although now I probably would have made it flexible, using more general conversions to a single variable then branching it from there. (Ex: (Inaccurate) 1$ CAD=1.2$ USD, 1$USD=10 Yen, Therefore 1$ CAD=1.2×10 Yen, 1$ CAD=12 Yen.)
If it doesn't run, on Google Chrome, right click. Then, click "Inspect". Then press "Console" then copy and paste the code below, and press Enter. (Ignore some of the text changing throughout the pictures.) (Other/better options below.)
The code:
var use=prompt ("This is a currency conversion program. Do you want to use it?
(Only relevant for a specific post.) 1=Yes, 2=No.")
if (use>0&&use<2){
alert ("Currency conversion program based in 2021 May 5th. Currency conversion may not be accurate by the time of use. All info was provided by Google and associated companies. Some information may be inexact. If there is an error, you must restart the program. Only answer as suggested.")
alert ("This has Canadian Dollars (CAD), American Dollars (USD), European Euros (EUR), Japanese Yen (JPY), Chinese Yuan (CNY/RMB?), and British Pounds (GBP) (Also known as Sterling Pounds.)")
var side1=prompt ("What currency are you using? (Type it in the order it was stated:Canadian=1, American=2, Euros=3, Yen=4, Yuan=5, and British Pounds=6.)")
var side2=prompt ("What do you want to convert it into? Same rules apply.(Canadian=1, American=2, Euros=3, Yen=4, Yuan=5, and British Pounds=6)")
var money=prompt ("How much money would you like to convert?")
if (money>99998&&money<100000){
alert ("You are like my brother Noah.")
}else{
if (side1>0&&side1<2){
if (side2>1&&side2<3){
alert (money + " dollars in Canadian is " + (money*0.82) + " in American Dollars.")
}else if (side2>2&&side2<4){
alert (money + " dollars in Canadian is " + (money*0.68) + " in Euros.")
}else if (side2>3&&side2<5){
alert (money + " dollars in Canadian is " + (money*89.12) + " in Yen.")
}else if (side2>4&&side2<6){
alert (money + " dollars in Canadian is " + (money*5.28) + " in Yuan.")
}else if (side2>5&&side2<7){
alert (money + " dollars in Canadian is " + (money*0.59) + " in British Pounds.")
}else if (side2>0&&side2<2){
alert ("It's the same.")
}else {
alert ("Please reread the instructions and follow them.")
}
}else if (side1>1&&side1<3)
if (side2>1&&side2<3){
alert ("It's the same.")
}else if (side2>2&&side2<4){
alert (money + " dollars in American is " + (money*0.83) + " in Euros.")
}else if (side2>3&&side2<5){
alert (money + " dollars in American is " + (money*109.29) + " in Yen.")
}else if (side2>4&&side2<6){
alert (money + " dollars in American is " + (money*6.47) + " in Yuan.")
}else if (side2>5&&side2<7){
alert (money + " dollars in American is " + (money*0.72) + " in British Pounds.")
}else if (side2>0&&side2<2){
alert (money + " dollars in American is " + (money*1.23) + " in Canadian Dollars.")
}else{
alert ("Please reread the instructions and follow them.")
}
else if (side1>2&&side1<4){
if (side2>1&&side2<3){
alert (money + " in Euros is " + (money*1.2) + " in American Dollars.")
}else if (side2>2&&side2<4){
alert ("It's the same.")
}else if (side2>3&&side2<5){
alert (money + " in Euros is " + (money*131.07) + " in Yen.")
}else if (side2>4&&side2<6){
alert (money + " in Euros is " + (money*7.77) + " in Yuan.")
}else if (side2>5&&side2<7){
alert (money + " in Euros is " + (money*0.86) + " in British Pounds.")
}else if (side2>0&&side2<2){
alert (money + " in Euros is " + (money*1.47) + " in Canadian Dollars.")
}else {
alert ("Please reread the instructions and follow them.")
}
}else if (side1>3&&side1<5){
if (side2>1&&side2<3){
alert (money + " in Yuan is " + (money*0.15) + " in American.")
}else if (side2>2&&side2<4){
alert (money + " in Yuan is " + (money*0.13) + " in Euros.")
}else if (side2>3&&side2<5){
alert (money + " in Yuan is " + (money*16.87) + " in Yen.")
}else if (side2>4&&side2<6){
alert ("It's the same.")
}else if (side2>5&&side2<7){
alert (money + " in Euros is " + (money*0.11) + " in British Pounds.")
}else if (side2>0&&side2<2){
alert (money + " in Euros is " + (money*0.19) + " in Canadian.")
}else {
alert ("Please reread the instructions and follow them.")
}
}else if (side1>4&&side1<6){
if (side2>1&&side2<3){
alert (money + " in British Pounds is " + (money*1.39) + " in American.")
}else if (side2>2&&side2<4){
alert (money + " in British Pounds is " + (money*1.16) + " in Euros.")
}else if (side2>3&&side2<5){
alert (money + " in British Pounds is " + (money*151.85) + " in Yen.")
}else if (side2>4&&side2<6){
alert (money + " in British Pounds is " + (money*9) + " in Yuan.")
}else if (side2>5&&side2<7){
alert ("It's the same.")
}else if (side2>0&&side2<2){
alert (money + " in British Pounds is " + (money*1.71) + " in Canadian.")
}else {
alert ("Please reread the instructions and follow them.")
}
}else {
alert ("Please reread the instructions and follow them.")
}
}
}else{
alert ("Okay.")
}
If that doesn't work, use JSFiddle (https://jsfiddle.net/mh3z0fwp/2/), and just use the link. If that doesn't work, in the JS section (bottom left quarter) put in this code (it's different that above, but does the exact same thing. Google counts a paragraph ending as a semicolon, and most JS doesn't work that way) If it doesn't run, you stop it, or you want to activate it again, use the "Run" button at the top left:
var use=prompt ("This is a currency conversion program. Do you want to use it. (Only relevant for a specific post.) 1=Yes, 2=No.")
if (use>0&&use<2){ alert ("Currency conversion program based in 2021 May 5th. Currency conversion may not be accurate by the time of use. All info was provided by Google and associated companies. Some information may be inexact. If there is an error, you must restart the program. Only answer as suggested.");alert ("This has Canadian Dollars (CAD), American Dollars (USD), European Euros (EUR), Japanese Yen (JPY), Chinese Yuan (CNY/RMB?), and British Pounds (GBP) (Also known as Sterling Pounds.)");var side1=prompt ("What currency are you using? (Type it in the order it was stated:Canadian=1, American=2, Euros=3, Yen=4, Yuan=5, and British Pounds=6.)");var side2=prompt ("What do you want to convert it into? Same rules apply.(Canadian=1, American=2, Euros=3, Yen=4, Yuan=5, and British Pounds=6)");var money=prompt ("How much money would you like to convert?");if (money>99998&&money<100000){ alert ("You are like my brother Noah.") }else{ if (side1>0&&side1<2){ if (side2>1&&side2<3){ alert (money + " dollars in Canadian is " + (money*0.82) + " in American Dollars.") }else if (side2>2&&side2<4){ alert (money + " dollars in Canadian is " + (money*0.68) + " in Euros.") }else if (side2>3&&side2<5){ alert (money + " dollars in Canadian is " + (money*89.12) + " in Yen.") }else if (side2>4&&side2<6){ alert (money + " dollars in Canadian is " + (money*5.28) + " in Yuan.") }else if (side2>5&&side2<7){ alert (money + " dollars in Canadian is " + (money*0.59) + " in British Pounds.") }else if (side2>0&&side2<2){ alert ("It's the same.") }else { alert ("Please reread the instructions and follow them.") } }else if (side1>1&&side1<3) if (side2>1&&side2<3){ alert ("It's the same.") }else if (side2>2&&side2<4){ alert (money + " dollars in American is " + (money*0.83) + " in Euros.") }else if (side2>3&&side2<5){ alert (money + " dollars in American is " + (money*109.29) + " in Yen.") }else if (side2>4&&side2<6){ alert (money + " dollars in American is " + (money*6.47) + " in Yuan.") }else if (side2>5&&side2<7){ alert (money + " dollars in American is " + (money*0.72) + " in British Pounds.") }else if (side2>0&&side2<2){ alert (money + " dollars in American is " + (money*1.23) + " in Canadian Dollars.") }else{ alert ("Please reread the instructions and follow them.") } else if (side1>2&&side1<4){ if (side2>1&&side2<3){ alert (money + " in Euros is " + (money*1.2) + " in American Dollars.") }else if (side2>2&&side2<4){ alert ("It's the same.") }else if (side2>3&&side2<5){ alert (money + " in Euros is " + (money*131.07) + " in Yen.") }else if (side2>4&&side2<6){ alert (money + " in Euros is " + (money*7.77) + " in Yuan.") }else if (side2>5&&side2<7){ alert (money + " in Euros is " + (money*0.86) + " in British Pounds.") }else if (side2>0&&side2<2){ alert (money + " in Euros is " + (money*1.47) + " in Canadian Dollars.") }else { alert ("Please reread the instructions and follow them.") } }else if (side1>3&&side1<5){ if (side2>1&&side2<3){ alert (money + " in Yuan is " + (money*0.15) + " in American.") }else if (side2>2&&side2<4){ alert (money + " in Yuan is " + (money*0.13) + " in Euros.") }else if (side2>3&&side2<5){ alert (money + " in Yuan is " + (money*16.87) + " in Yen.") }else if (side2>4&&side2<6){ alert ("It's the same.") }else if (side2>5&&side2<7){ alert (money + " in Euros is " + (money*0.11) + " in British Pounds.") }else if (side2>0&&side2<2){ alert (money + " in Euros is " + (money*0.19) + " in Canadian.") }else { alert ("Please reread the instructions and follow them.") } }else if (side1>4&&side1<6){ if (side2>1&&side2<3){ alert (money + " in British Pounds is " + (money*1.39) + " in American.") }else if (side2>2&&side2<4){ alert (money + " in British Pounds is " + (money*1.16) + " in Euros.") }else if (side2>3&&side2<5){ alert (money + " in British Pounds is " + (money*151.85) + " in Yen.") }else if (side2>4&&side2<6){ alert (money + " in British Pounds is " + (money*9) + " in Yuan.") }else if (side2>5&&side2<7){ alert ("It's the same.") }else if (side2>0&&side2<2){
alert (money + " in British Pounds is " + (money*1.71) + " in Canadian.")
}else {
alert ("Please reread the instructions and follow them.")
}
}else {
alert ("Please reread the instructions and follow them.")
}
}
}else{
alert ("Okay.")
}
JSFiddle
If you have any other problems, you can tell me in the comments of this page.