Question

In: Computer Science

Write a JavaScript program to read and analyze the assessment results of a unit under Node.js...

Write a JavaScript program to read and analyze the assessment results of a unit under Node.js host environment. The assessment results are read from the keyboard. The input consists of a list of student results. Each student's result includes the student's name and his or her mark for that unit. These results must be stored in one or several arrays. The input ends when the user types "end".

Once all assessment results are read in, your program should produce a table that summarises the number of students in each grade (HD, D, C, P and N) as well as the percentage of students in each grade. Finally, display the name and mark of the best student.

After the summary table and the best student are displayed, your program prompts the user to inquire about a student's mark. For example, if the user enters the name "John", your program should display the names and marks of all students whose names contain the string "John" (ignore the case).

Your program should allow the user to keep making queries until the user types "stop".

Test and run the above program using Node.js only. Do not use a web browser to test and run your program.

Hints: you may use multiple console.logs to output the data in table-like manner. However, it would be difficulty to make the data in the table properly aligned. Alternatively, you may place the data in a JavaScript object and output the object using console.table. Eg:

(where var hd, d, c, p = number of students in each grade and hdp, dp, cp, pp = percentage of students in each grade)

var hd = ;

var d = ;

var c = ;

var p = ;

var hdp = ;

var dp = ;

var cp = ;

var pp = ;

var table = {};

table.HD = { number: hd, '%': hdp };

table.D = { number: d, '%': dp };

table.C = { number: c, '%': cp };

table.P = { number: p, '%': pp };

console.table (table);

Solutions

Expert Solution


Related Solutions

Write a simple javascript program using express and node.js to create a simple webpage that can...
Write a simple javascript program using express and node.js to create a simple webpage that can lead to other pages within the program. if possible, Comment everything out so I could understand how every things works.  But basically, server should be hosted on localhost:8000 and should have a simple starting page. Maybe a welcome message, with at least two "links" that goes to a "homepage" and then a "exit" page.
Write the below code to use HTML and JavaScript. 1. a) Write a JavaScript program to...
Write the below code to use HTML and JavaScript. 1. a) Write a JavaScript program to display the current day and time. b) Write a JavaScript program to print the contents of the current window.   c) Write a JavaScript program where the program takes a random integer between 1 to 10 d) Write a JavaScript program to calculate multiplication and division of two numbers (input from the user). e)Write a JavaScript program to create a new string from a given...
Using Node.js, show how you would read a file and and write out its contents to...
Using Node.js, show how you would read a file and and write out its contents to a new file in reverse order. As an example, if the source file had: Roses are red, Violets are blue. If the Trump administration continues to lose cabinet members, I will not be sad. Boo hoo hoo. The destination file would have: I will not be sad. Boo hoo hoo. If the Trump administration continues to lose cabinet members, Violets are blue. Roses are...
Write the programs in JavaScript: Write a program that reads a text file and outputs the...
Write the programs in JavaScript: Write a program that reads a text file and outputs the text file with line numbers at the beginning of each line.
Write a JavaScript program that computes the average of a collection of numbers and then outputs...
Write a JavaScript program that computes the average of a collection of numbers and then outputs the total number of values that are greater than the average. An A grade is any score that is at least 20% greater than the average. The B grade is any score that is not an A, but is at least 10% greater than the average. An F grade is any score that is at least 20% less than the average. The D grade...
Write a defining table and a JavaScript program that computes and outputs the rate of change...
Write a defining table and a JavaScript program that computes and outputs the rate of change of a price. The program must allow the user to enter a previous price and a current price. The formula for the rate of change is rateOfChange =  currPrice - prevPrice prevPrice Your program should allow a user to enter real numbers such as 7.54. If you wish, you may use the following HTML code in your program. <!DOCTYPE HTML> <html lang="en-us"> <head> <meta charset="utf-8">...
Write a discussion on the value of knowing how to run and read the results of...
Write a discussion on the value of knowing how to run and read the results of the ANOVA statistical analysis for today's marketing agents. Write a discussion on potential shortcomings or weaknesses of the ANOVA analysis and when the marketing agent should and should not use the ANOVA. Minimum word count is 400 words. Your original post must include a minimum of two outside resources - used to support your writing
Write a discussion on the value of knowing how to run and read the results of...
Write a discussion on the value of knowing how to run and read the results of the ANOVA statistical analysis for today’s marketing agents. Write a discussion on potential shortcomings or weaknesses of the ANOVA analysis and when the marketing agent should and should not use the ANOVA.
Write a javascript program according to the follow requirements: Create a function that converts Fahrenheit to...
Write a javascript program according to the follow requirements: Create a function that converts Fahrenheit to Celsius. It takes a single argument which represents degrees in Fahrenheit. It converts it and returns the degrees in Celsius. Create another function that converts Celsius to Fahrenheit. It takes a argument in Celsius and returns the degrees in Fahrenheit. Implement the function convert(isFtoC, from, to) below. It takes the following three arguments: isFtoC: a boolean that is true if degrees must be converted...
Write a javascript program that computes the total cost for a five year car lease. The...
Write a javascript program that computes the total cost for a five year car lease. The program starts with a monthly leasing amount and a yearly increase in percent. The program then outputs the total amount paid for each year and the total overall cost of the lease.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT