Question
The below code generates a console program that converts numbers into German or Grench Convert the following JavaScript into Psuedo code var french = [Zro,
The below code generates a console program that converts numbers into German or Grench
Convert the following JavaScript into Psuedo code
var french = ["Zro", "Un", "Deux", "Trois", "Quatre", "Cinq", "Six", "Sept", "Huit", "Neuf", "Dix", "Onze", "Douze", "Treize", "Quatorze", "Quinze", "Sieze", "Dix-sept", "Dix-huit", "Dix-neuf", "Vingt", "Vingt Et Un", "Vingt - deux", "Vingt - trois", "Vingt - quatre", "Vingt - cinq", "Vingt-six", "Vingt-sept", "Vingt-huit", "Vingt-neuf", "Trente" ];
var german = ["Null", "Eins", "Zwei", "Drei", "Vier", "Fnf", "Sechs", "Sieben", "Acht", "Neun", "Zehn", "Elf", "Zwlf", "Dreizehn", "Vierzehn", "Fnfzehn", "Sechzehn", "Siebzehn", "Achtzehn", "Neunzehn", "Zwanzig", "Einundzwanzig", "Zweiundzwanzig", "Dreiundzwanzig", "Vierundzwanzig", "Fnfundzwanzig", "Sechsundzwanzig", "Siebenundzwanzig", "Achtundzwanzig", "Neunundzwanzig", "Dreiig" ];
var number = parseInt(prompt("Enter number to translate?"));
while (number < 0 || number > 30) { alert("Please enter a number between 1 and 30"); number = prompt("Please enter an integer between 1 and 30"); }
var lang = prompt("Please enter translation language, French or German ? ");
while(lang != "french" && lang != "german") { alert("Please enter a valid language (french or german)"); lang = prompt("Please enter translation language, French or German ? "); }
var word = lang === "french" ? french[number] : german[number]; alert("the number " + number +" in " + lang+" is "+ word);
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started