Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Repairing And Querying Databases Under Aggregate Constraints

Authors: Sergio Flesca ,Filippo Furfaro ,Francesco Parisi

2011th Edition

146141640X, 978-1461416401

More Books

Students also viewed these Databases questions

Question

How would you describe your typical day at work?

Answered: 1 week ago

Question

2. Write two or three of your greatest weaknesses.

Answered: 1 week ago