Create a file named histogram.js. Write a program that will allow me to enter numbers between 1 and 100. I will enter numbers until I enter 0. Iterate over the array and display a histogram for the numbers entered. Don't overcomplicate the histrogram piece. Displaying the histogram only involves printing an asterick for the number of times a number is contained in the array. I need to write this program using const readline = require('readline');
Q: Which registers are used as passing parameters in a function or as a return value normally? The code…
A: A) The "push" statements on lines 4 and 5 are used to store the contents of registers r4 and r5 on…
Q: The OSI reference model says that there must be seven, but this isn't always the case. Why try to…
A: The OSI (Open Systems Interconnection) reference model is a conceptual model that standardizes the…
Q: What are the pros and cons of real-time versus non-real-time computer operating systems, and what…
A: Computer operating systems can be divided into two categories: real-time operating systems (RTOS)…
Q: Create a test driver application that applies the approaches in our ordered symbol-table API to…
A: Create a class called SymbolTableTestDriver with a main method. Inside the main method, create four…
Q: Create a system that will allow a user to add and remove vehicles from an inventory system. Vehicles…
A: The prompt is asking for the creation of a system that allows a person to add and delete vehicles…
Q: utilising Mafiaboy's online investigation techniques He did not wish to disclose when or how his…
A: In this inquiry, we need to understand the tactics utilized to corner Mafiaboy, especially…
Q: HhhQuiz score: 80 Mid-term score: 68 Final score: 90.
A: The question asks us to write a Python program that determines a student's grade based on three…
Q: Create and deploy a programme that can read up to 25 pairs of names and postal (ZIP) codes for each…
A: The code reads each line of input, splits it into the first name, last name, and postal code using…
Q: what type of logic circuit is this (e.g. shift register, etc), and how is this used in real world…
A: The logic circuit shown in the diagram is a basic digital circuit consisting of an AND gate, a…
Q: 1. Excel interprets commas as function argument _____. 2. When you type = and then a letter, Blank…
A: Here is your solution -
Q: Why are internal and external routing protocols so prevalent in the twenty-first century?
A: In the twenty-first century, internal and external routing protocols are used for a number of…
Q: Which of the following is the time equation of the Hesap function? Hesap(n) if n==0 return 1 else…
A: The time equation of the Hesap function can be determined using the master theorem, which provides a…
Q: write a method to read a list of salary amounts that start with a dollar sign $ and followed by a…
A: According to the information given:- We have to follow the instruction in order to get the desired…
Q: Create a hash table that can be dynamically resized to record the names and Social Security numbers…
A: A hash table is a data structure that allows storing and retrieving values based on keys. It uses a…
Q: What is the output of the following code? Explain each line of the console output in your own words.…
A: import java.util.ArrayList; public class Pet {public void goToVet(){System.out.println("My Pet needs…
Q: Examine this prototype. Assuming that the function prototype is written correctly and that it is…
A: Given Function: void populate(const int ids[], float payRate[], const int size = G_SIZE) We have to…
Q: Compare and contrast digital piracy with other forms of intellectual property theft.
A: The use, replication, and distribution of digital content—including software, music, movies, and…
Q: Increase your knowledge of social media. Autonomous computing versus cloud computing? These examples…
A: Social media refers to online platforms and tools that allow people to create, share, and exchange…
Q: Prepare in advance for emergency situations. Where do mobile backup solutions differ most from…
A: A calamity is an event that causes significant damage, destruction, or loss of life. It is an…
Q: If we were to run the following program for the list = {100, 27, 35, 49, 15, 19, 29, 88, 37, 76, 45,…
A: Merge sort is a sorting algorithm that sorts a list of elements using a divide-and-conquer strategy.…
Q: The waterfall design of your project: traditional or iterative? What will make this better?
A: The waterfall model is a sequential, linear method for developing software where each stage is…
Q: Why is using cloud computing for both data storage and analysis advantageous?
A: Why is using cloud computing for both data storage and analysis advantageous?
Q: How do computer networks and protocols such as TCP/IP, DNS, and HTTP enable communication and data…
A: TCP/IP (Transmission Control Protocol/Internet Protocol) is the underlying communication protocol…
Q: How can I maintain my anonymity while using the office computer and printer
A: Maintaining anonymity while using the office computer and printer can be challenging as both devices…
Q: Write a Java program that prompts the user to enter a string 2. Create two methods. One method will…
A: In Java, strings are sequences of characters represented as objects of the String class, which is a…
Q: Tell me the test cases of door and how to perform integration testing of door?
A: To conduct integration testing on a door, it is essential to consider the individual components that…
Q: Fix the code so it runs. Take note of what errors are generated by the compiler. What do these…
A: We have been given a java program there are some error are in the code we have to remove the error…
Q: If you had to choose between the waterfall approach and a more innovative method, you may opt for…
A: We have to define If you had to select between the waterfall method and a more modern one, you may…
Q: Is there any advantage to contacting someone on the phone?
A: In today's world we have access to many communication methods such as email, text and phone calls.…
Q: Design a logic circuit or a block diagram of what the a "D flip-flop with enable" would look like…
A: The D flip-flop with enable circuit consists of three main components: the AND gate, the flip-flop,…
Q: 1. A startup Internet company has generated the following cash balance for the first six years of…
A: Note: According to the guidelines we can only answer 3 sub parts, please post the remaining…
Q: Consider the following arguments, in each case determine whether the argument is valid, i.e., is it…
A: The given prompt presents four argument forms in deductive logic and asks to determine whether each…
Q: Please provide a summary of the criteria that should be considered when selecting an input field for…
A: Selecting the appropriate input fields for data collection is a crucial aspect of designing user…
Q: Question - Right of stoppage in transit begins when the right of lien ends . Discuss
A: 1) The concept of "right of stoppage in transit" refers to a legal right that a seller has to stop…
Q: Wireless networks have their own special problems because they are built in a different way than…
A: In this question we have to understand and provide three real-world examples of how these problems…
Q: Should database designers be aware of any particular strategy that, depending on context, has the…
A: Answer is explained below in detail
Q: I need help with my context free language. It needs to do the following 1. Developing a language…
A: You need help with creating a context-free language model in Java that can generate grammatically…
Q: The Java hash function for Strings generates a hash code based on the string's maximum length. Given…
A: The maximum length of a string, which is 231 - 1, is the foundation for the Java hash function for…
Q: Consider a system with 2 level caches. Access times of Level 1 cache, Level 2 cache, and main memory…
A: In this question, we're going to explore a two-level cache system and calculate the average access…
Q: Write a program that does two string functions: capitalize the first word of a phrase, and reverse…
A: Manipulating and formatting text is a common task in programming. In this problem, we are tasked…
Q: write a java progam of a bean that encapsulates the data in a form with elements named name, city…
A: Java is one of the popular language which is used for developing android applications,…
Q: Modern appliances can be controlled and networked remotely thanks to technology breakthroughs. Can…
A: Yes, as more businesses use wireless information appliances and services, we can anticipate a…
Q: Give three advantages of the cascade method over the incremental method.
A: 1) The cascade model and incremental model are two popular software development models used in the…
Q: If F(x, y, z) = (xy+z'), what is the complement of F? You need to simplify it.
A: Dear learner, hope you are doing well, I will try my best to answer this question. Thank You!!
Q: need help with my context free language. It needs to do the following 1. Developing a language model…
A: You need help with creating a context-free language model in Java that can generate grammatically…
Q: Give six examples of the different types of process technologies that are used to make customizable…
A: PLDs are integrated circuits that may be programmed to carry out a number of different digital…
Q: A list can be a value inside a dictionary. Select one: True False
A: What is python: Python is a high-level, interpreted programming language that emphasizes code…
Q: PYTHON class BSTnode: def __init__(self, key = None, left = None, right = None, parent = None):…
A: The Python code below defines a Binary Search Tree (BST) node class containing methods for setting…
Q: CPU is executing these sequences of instructions A, BEQ G, C, D, E. CPU tasks are divided into 5…
A: To determine the number of cycles it will take to finish the sequence of instructions A, BEQ G, C,…
Q: You are chosen as one of the members of the human resource committee in the company and tasked to…
A: As a member of the human resource committee, you should create a hiring policy that is fair,…
Create a file named histogram.js. Write a
I need to write this program using
Step by step
Solved in 3 steps with 1 images
- The assignment is "Create a file named histogram.js. Write a program that will allow me to enter numbers between 1 and 100. I will enter numbers until I enter 0. Iterate over the array and display a histogram for the numbers entered. Don't overcomplicate the histrogram piece. Displaying the histogram only involves printing an asterick for the number of times a number is contained in the array." i wrote a program but i cannot run it, my program is: const readline = require('readline'); const rl = readline.createInterface({ input: process.stdin, output: process.stdout }); const arr = []; rl.question('Enter a number between 1 and 100 (or 0 to quit) : ', (num) => { arr.push(parseInt(num)); while (num !== 0) { if (num >= 1 && num <= 100) { arr.push(num); } rl.question('', (num) => {; arr.push(parseInt(num)); rl.close(); }); for (let i = 1; i <= 100; i++) { let count = 0; for (let j = 0; j < arr.length; j++) { if (arr[j] === i)…TASK 1. Prior to writing your code, you will create an input file for this assignment yourself and name it input.txt. Open the CreateInput.java file, attached to this assignment in Blackboard and analyze its code. Find the 2D array of items and add three more grocery items and their type of your choice into this array. In the same code, find an array of countries and add two more countries of your choice to this 1D array.Computer Science Write a program that uses 3 command line arguments to search a list of float numbers in a file and prints out the result of whether the number was found or not on the console. Also, it prints the array in the reverse order (not sorted but reverse order of how the numbers were read in). The first argument is the name of the input file which has the numbers to be searched, the second is an integer specifying how many numbers are in the input file and the third argument is the float number being searched for. Use dynamic memory allocation for the array and use a function (that returns a boolean value) to do the searching. Also make sure in the beginning of your program, that the program will execute only if exactly three arguments (other than executable name itself) are specified. at the command line.
- For this assignment you will be working with arrays and File I/O. Open a new Java file called Nums.java Prompt a user to enter the name of a text file containing a series of numbers. Important Note: the user should be able to type the name any file that is contained inside their own personal Assignment 18 Java project in Eclipse. Open the file for reading. The first line of the text file will contain the number of numbers in the file. Declare an array of the length specified on this first line of the text file. The subsequent line in the text file will contain a sequence of double numbers - the exact number indicated in the first line of the file. Read this sequence of numbers into the array using a for loop. Using the same, or a second, for loop, sum the numbers and report their sum to the user. Also, multiply the numbers together and report their product to the user. Then, print this information in a text file named results.txt. The sum and the product should be printed to one…Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…
- Given a text file containing the availability of food items, write a program that reads the information from the text file and outputs the available food items. The program first reads the name of the text file from the user. The program then reads the text file, stores the information into four separate arrays, and outputs the available food items in the following format: name (category) -- description Assume the text file contains the category, name, description, and availability of at least one food item, separated by a tab character. Ex: If the input of the program is: food.txt and the contents of food.txt are: Sandwiches Ham sandwich Classic ham sandwich Available Sandwiches Chicken salad sandwich Chicken salad sandwich Not available Sandwiches Cheeseburger Classic cheeseburger Not available Salads Caesar salad Chunks of romaine heart lettuce dressed with lemon juice Available Salads Asian salad Mixed greens with ginger dressing, sprinkled with sesame Not available Drinks Water…1. In this lab, you will read two files. Firstly, the ‘AccountData.csv’ file has the name and account number.Use each account number to scan the ‘BankData.csv’ file for a matching account number to get a ‘balance’from the account transactions. You must repeatedly open, read the ‘BankData.csv’ file and close it for eachaccount number in the ‘AccountData.csv’ file unless you wish to store its entire contents in a static array.(More code and may not be enough time to complete.)2. So, for this lab, read my pseudocode in the given java files FIRST!!3. ANALYZE my code carefully.4. Then start coding the solution. I have given the solution to each lab instructor to help you during the timefor your specific lab.5. You will submit in iCollege, ONLY one file: BankDataProcessing.java6. No need to submit the data files or the BankAccount ‘object’ file.7. Do NOT MODIFY the ‘BankAccount.java’ file. PLEASE COMPLETE THE JAVA CODE BELOW AND MAKE SURE ITS LiKE THE OUTPUTimport java.io.*;import…1. In this lab, you will read two files. Firstly, the ‘AccountData.csv’ file has the name and account number.Use each account number to scan the ‘BankData.csv’ file for a matching account number to get a ‘balance’from the account transactions. You must repeatedly open, read the ‘BankData.csv’ file and close it for eachaccount number in the ‘AccountData.csv’ file unless you wish to store its entire contents in a static array.(More code and may not be enough time to complete.)2. So, for this lab, read my pseudocode in the given java files FIRST!!3. ANALYZE my code carefully.4. Then start coding the solution. I have given the solution to each lab instructor to help you during the timefor your specific lab.5. You will submit in iCollege, ONLY one file: BankDataProcessing.java6. No need to submit the data files or the BankAccount ‘object’ file.7. Do NOT MODIFY the ‘BankAccount.java’ file. import java.io.*;import java.nio.file.Files;import java.nio.file.Path;import java.nio.file.Paths;import…
- Create a program that allows you to create a fantasy football roster based on the existing list of available players. Your team can only have 5 players, so create an array that can store 5 possible players. Prompt the user to pick 5 players to add to their team. If the player is available in the list of availablePlayers, then add that player to the users array, and remove that player from the availablePlayers list. Then prompt the user to pick another player. Once all five players have been added, then print the list in the console. Create a search method to find the index at which the player is located in the availablePlayers list so you can remove the player, and make sure that they are an eligible pick. Here is a sample run of the program: Enter Player you would like on your team: Cam Newton Great! That player is added to your team! Enter Player you would like on your team: Travis Kelce Great! That player is added to your team! Enter Player you would like on your team: Alvin Kamara…Write a program that fills an array with user input and displays 1) size, 2) average, 3) maximum and 4) minimum value of the array.I. Create four source files (.asm) as follows. (Refer to the class lectures for details.)1) A file containing the definitions of the following three functions. (You may name it io.asm.)getInputstoiitos2) A file containing the definition of the following function,; Function computeAvg (value-returning function); Purpose: Compute the average of the elements in an array; Parameter 1: address of array (pass by reference)- input parameter; Parameter 2: array size (pass by value)- input parameter; Return value: average of the elements in an array3) A file containing the definition of the following function,; Function maxMin; Purpose: Find the largest and smallest values in an array; Parameter 1: maximum of an array (pass by reference)- output parameter; Parameter 2: minimum of an array (pass by reference)- output parameter; Parameter 3: address of array (pass by…write a program that reads up to 100 numbers from a file. As you read thenumbers, insert them into an array in ascending order.Specifications:1A. Write a function called addToArrayAsc.i. It should take three arguments -a. sortedArray[ ] : sorted array that should be able to hold at most 100 floats.b. numElements : the number of elements inserted so far.c. newValue : the incoming float value to be inserted into the sortedArray.ii. The addToArrayAsc function should return a count of the elements inserted so far(i.e. the current size of the array).The function header will appear as follows: OBJECTIVES 1. Read-in command line arguments2. Read a file3. Loop through an array4. Split a string5. Create an array of struct types6. Read and Write to a file int addToArrayAsc(float sortedArray[], int numElements, float newValue);