The program is in JavaScript and must use const readline = require('readline'); 1. Create a file named dedup.js. Write a program that removes duplicates from an array. The program should be able to read an unspecified number of numbers input by the user. The user should enter a negative number when they are done entering scores. The program should remove all duplicates from the array and then iterate over the new array and display it. 2. Create a file named dedeup_2.js. Modify your dedup program and prompt the user to enter a number n. Remove all elements from the array that occur more than n times.

EBK JAVA PROGRAMMING
9th Edition
ISBN:9781337671385
Author:FARRELL
Publisher:FARRELL
Chapter8: Arrays
Section: Chapter Questions
Problem 1GZ
icon
Related questions
Question

The program is in JavaScript and must use const readline = require('readline');

1. Create a file named dedup.js. Write a program that removes duplicates from an array. The program should be able to read an unspecified number of numbers input by the user. The user should enter a negative number when they are done entering scores. The program should remove all duplicates from the array and then iterate over the new array and display it.

2. Create a file named dedeup_2.js. Modify your dedup program and prompt the user to enter a number n. Remove all elements from the array that occur more than n times.

Expert Solution
steps

Step by step

Solved in 4 steps with 4 images

Blurred answer
Knowledge Booster
Array
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
EBK JAVA PROGRAMMING
EBK JAVA PROGRAMMING
Computer Science
ISBN:
9781337671385
Author:
FARRELL
Publisher:
CENGAGE LEARNING - CONSIGNMENT
Programming with Microsoft Visual Basic 2017
Programming with Microsoft Visual Basic 2017
Computer Science
ISBN:
9781337102124
Author:
Diane Zak
Publisher:
Cengage Learning
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage