What seems  the problem here? Im using Programiz's Javascript compiler

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter3: Understanding Structure
Section: Chapter Questions
Problem 7RQ
icon
Related questions
Question

What seems  the problem here? Im using Programiz's Javascript compiler
CODE:
//Print menu
console.log("1: String Concatenation")
console.log("2: String Comparison")
console.log("3: Fibonacci Sequence")
console.log("4: Floyd Triangle")
console.log("5: Quit")
//User input 
var n = prompt("Choose one: ");
//Compare choice and perform required operation
switch (n) {
  case 1:
    var string1 = prompt("Enter the first string: ");
    var string2 = prompt("Enter the second string: ");
    alert(string1 + string2);
    break;
  case 2:
    var string1 = prompt("Enter the first string: ");
    var string2 = prompt("Enter the second string: ");
    if (string1 == string2) {
      alert("The strings are equal");
    } else {
      alert("The strings are not equal");
    }
    break;
  case 3:
    var n = prompt("Enter the number of terms: ");
    var a = 0;
    var b = 1;
    var c;
    alert("The Fibonacci sequence is: ");
    alert(a);
    alert(b);
    for (i = 2; i < n; i++) {
      c = a + b;
      a = b;
      b = c;
      alert(c);
    }
    break;
  case 4:
    var n = prompt("Enter the number of rows: ");
    var num = 1;
    alert("The Floyd triangle is: ");
    for (i = 1; i <= n; i++) {
      for (j = 1; j <= i; j++) {
        process.stdout.write(num + " ");
        num++;
      }
      process.stdout.write("\n");
    }
    break;
  case 5:
    alert("Thank you!");
    break;
  default:
    alert("Invalid input");
}

Output
node / tmp/rQnF6Iaccl.js
1: String Concatenation
2: String Comparison
3: Fibonacci Sequence
4: Floyd Triangle
5: Quit
internal/modules/cjs/loader.js:638
throw err;
Error: Cannot find module 'readline-sync'
at Function. Module._resolveFilename (internal/modules/cjs/loader.js:636:15)
at Function. Module._load (internal/modules/cjs/loader.js:562:25)
at Module.require (internal/modules/cjs/loader.js:692:17)
at require (internal/modules/cjs/helpers.js:25:18)
at Object.<anonymous> (/tmp/rQnF6Iaccl.js:8:9)
at Module._compile (internal/modules/cjs/loader.js:778:30)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10)
at Module.load (internal/modules/cjs/loader.js:653:32)
at tryModuleload (internal/modules/cjs/loader.js:593:12)
at Function. Module._load (internal/modules/cjs/loader.js:585:3)
Transcribed Image Text:Output node / tmp/rQnF6Iaccl.js 1: String Concatenation 2: String Comparison 3: Fibonacci Sequence 4: Floyd Triangle 5: Quit internal/modules/cjs/loader.js:638 throw err; Error: Cannot find module 'readline-sync' at Function. Module._resolveFilename (internal/modules/cjs/loader.js:636:15) at Function. Module._load (internal/modules/cjs/loader.js:562:25) at Module.require (internal/modules/cjs/loader.js:692:17) at require (internal/modules/cjs/helpers.js:25:18) at Object.<anonymous> (/tmp/rQnF6Iaccl.js:8:9) at Module._compile (internal/modules/cjs/loader.js:778:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:789:10) at Module.load (internal/modules/cjs/loader.js:653:32) at tryModuleload (internal/modules/cjs/loader.js:593:12) at Function. Module._load (internal/modules/cjs/loader.js:585:3)
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps with 1 images

Blurred answer
Knowledge Booster
Multithreading Methods
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage
Systems Architecture
Systems Architecture
Computer Science
ISBN:
9781305080195
Author:
Stephen D. Burd
Publisher:
Cengage Learning