Questions
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);

In: Computer Science

Proof that One Time Pad (OTP) is perfectly secured under Ciphertext only attack (COA). Please explain...

Proof that One Time Pad (OTP) is perfectly secured under Ciphertext only attack (COA). Please explain briefly each step of the proof.

In: Computer Science

How to fix an ERP Failure?

How to fix an ERP Failure?

In: Computer Science

Why is it important to understand the “people side” of Enterprise Architecture? Compare and contrast an...

Why is it important to understand the “people side” of Enterprise Architecture?

Compare and contrast an organization and an enterprise.

How is the Organization Network Model different from the Parsons/Thompson Model of Organizations?

In: Computer Science

4. Compare Oracle verus SAP

4. Compare Oracle verus SAP

In: Computer Science

Write a Python function that receives a stack object s, where the items in the stack...

Write a Python function that receives a stack object s, where the items in the stack are only numbers in the set {0,1} and returns the number of 1's in the stack s. The function must satisfy the following restrictions:

  • the state of the stack must be preserved; ie., after calling this function the state of the stack s must be the same it was before the function was called.
  • The function cannot use any additional variables of any of the collection types such as lists, stacks, dictionaries, strings etc.
  • The function cannot use any global variables.
  • Since the implementation of Stack is not known you must use the API given in the Table 1.

For example, if the stack contains 0,0,1,1,0,1,0, the function must return 3 and the stack must still contain 0,0,1,1,0,1,0.

In: Computer Science

Draw the component diagram for an airline reservation system.

Draw the component diagram for an airline reservation system.

In: Computer Science

Write report on the application of an audit test in a specific system

Write report on the application of an audit test in a specific system

In: Computer Science

In [12]: pd.Series([1.0,np.NaN,5.9,6])+pd.Series([3,5,2,5.6]) Out[12]: 0 4.0 1 NaN 2 7.9 3 11.6 dtype: float64 In [13]:...

In [12]: pd.Series([1.0,np.NaN,5.9,6])+pd.Series([3,5,2,5.6])
Out[12]: 0     4.0
        1     NaN
        2     7.9
        3    11.6
        dtype: float64
In [13]: pd.Series([1.0,25.0,5.5,6])/pd.Series([3,np.NaN,2,5.6])
Out[13]: 0    0.333333
        1         NaN
        2    2.750000
        3    1.071429
       dtype: float64

What are they trying to explain here?

That pandas returns a missing value where one of the operands is missing

That pandas treats NaN values as zero, when an operation is performed

That pandas removes all records in which one of the operands is NaN

That the + and / operations in pandas are special cases in which the NaN values are treated as floats. The rest of the mathematical operations treat NaN values as strings.

In: Computer Science

Create a scheduler that takes unlimited processes. It will ask for number of jobs, arrival time,...

Create a scheduler that takes unlimited processes. It will ask for number of jobs, arrival time, and CPU burst time. It should use FCFS, SJF, and SRTF methods. It should also print out the gantt chart, waiting time, and turn around time for each of the processes. Please solve using Java.

In: Computer Science

Subject (DBA) use MYSQL workbench select my guitar shop database as default schema Question text Problem10...

Subject (DBA)

use MYSQL workbench select my guitar shop database as default schema

Question text

Problem10

Write a script that implements the following design in a database named household_chores:

Details

  • Include a statement to drop the database if it already exists.
  • Include statements to create and select the database.
  • Include any indexes that you think are necessary.
  • Specify the utf8 character set for all tables.
  • Specify the InnoDB storage engine for all tables.

Solution

______ DATABASE IF EXISTS ______ ;

CREATE DATABASE household_chores CHARSET _________ ;

________ ;

______   _______ (

         person_id       INT          PRIMARY KEY ______ ,

         first_name    VARCHAR(50) NOT NULL,

         last_name     VARCHAR(50) NOT NULL

) ENGINE = InnoDB;

CREATE TABLE chores (

         chore_id   INT         PRIMARY KEY _______

         name VARCHAR(100) UNIQUE

) _______

CREATE TABLE tasks (

         task_id   INT         PRIMARY KEY AUTO_INCREMENT,

         chore_id INT,

         name   _______ UNIQUE,

         CONSTRAINT fk_tasks_chores

                 _________

                 REFERENCES _______

) _______ = InnoDB;

CREATE TABLE assignments (

         _______    INT         PRIMARY KEY AUTO_INCREMENT,

         person_id   ______ ,

         task_id   INT,

         _______ fk_assignments_people

                 _______

                 REFERENCES _______ ,

         CONSTRAINT fk_assignments_tasks

                 ______

                 _______ tasks (task_id)

_______

In: Computer Science

Q.4.     A) How Data Dissemination in Vehicular Ad hoc Networks (VANETs) is achieved? explain in...

Q.4.     A) How Data Dissemination in Vehicular Ad hoc Networks (VANETs) is achieved?

explain in detail

In: Computer Science

Using Python Implement Recursive Selection Sort with the following recursive method. 1. Find the smallest number...

Using Python

Implement Recursive Selection Sort with the following recursive method.

1. Find the smallest number in the list and swaps it with the first number.

2.Ignore the first number and sort the remaining smaller list recursively.

In: Computer Science

Build a html form with the following elements. The form must be within a table structure....

Build a html form with the following elements. The form must be within a table structure.

• Current date: a non-editable textbox and should be in the format as shown (e.g. 12 October 2020 Monday 05:35 PM)

• Number of weeks till end of the year: a label showing the total number of weeks from now till 31st Dec 2020. (e.g. 17 days is 2 weeks and 3 days)

In: Computer Science

class listnodes{ int data;//first part of the node(data) listnodes link;//second part of the node(address) listnodes() {...

class listnodes{
int data;//first part of the node(data)
listnodes link;//second part of the node(address)
listnodes()
{
data=0;
link=null;
}
listnodes(int d,listnodes l)//10|null
{
data=d;
link=l;
}
}
class singlelinkedlist{
void display(listnodes head){
listnodes current=head;
while(current.link!=null){
System.out.print(current.data+"-->");
current=current.link;
}
System.out.print(current.data);
  
}
public listnodes insert(listnodes head,int data)
{
//create new node
listnodes newnode=new listnodes(data,null);
//link the newnode to the head node
newnode.link=head;
//make newnode the first node
head=newnode;
return head;//return the first node
}
//insert at a position(after or before a node)
public listnodes InsertAtPostion(listnodes head,int data,int position){
listnodes newnode=new listnodes(data,null);   
listnodes previous=head;
int count=1;
while(count<=position-1){//(count<position)
previous=previous.link;
count++;
}
// listnodess current=previous.link;
listnodes current=previous;
current=previous.link;
newnode.link=current;
previous.link=newnode;
return head;


}
public listnodes deletefirst(listnodes head){
listnodes temp=head;//rename
head=head.link;//move head
temp.link=null;//temp alone
return temp;
}
public listnodes deletelast(listnodes head){

if(head==null){
return head;
}
listnodes last=head;
listnodes previoustolast=head;
while(last.link!=null){
previoustolast=last;
last=last.link;
}
previoustolast.link=null;
return last;
}
public int length(listnodes head){
listnodes curr=head;
int c=0;
while(curr!=null){
c++;
curr=curr.link;
  
}
return c;
}
public boolean find(listnodes head,int searchkey){
listnodes curr=head;
while(curr!=null){
if(curr.data==searchkey)
{
return true;
}
curr=curr.link;
}
return false;
}
}

public class linkedlist {
public static void main(String[] args) {
//craete first node
listnodes head=new listnodes(10,null);
//create an object of class where all the methods are   
singlelinkedlist sl=new singlelinkedlist();
//insert at postion
sl.InsertAtPostion(head, 30, 1);

//insert at front
listnodes newhead=sl.insert(head,20);
sl.display(newhead);

//delete last
System.out.println(" ");
System.out.println("Delete a node at end");
listnodes l=sl.deletelast(head);
sl.display(l);
System.out.println(" ");
//delete first
System.out.println("\nDelete a node at begining and return head: \n");
listnodes first=sl.deletefirst(head);
sl.display(first);
System.out.println(" \n");
//find length
System.out.println("length is="+sl.length(head));
System.out.println(" ");
//Search a node
System.out.println("Search for a node");
if(sl.find(head, 10)){
System.out.println("key found");}
else
System.out.println("key not found");
}
}

ON THIS CODE

Write an application and perform the following:

-Create at least three classes such as:

1. listnode- for data and link, constructors

2. Singlelinkedlist-for method definition

3. linkedlist-for objects

-Insert a node at tail/end in a linked list.

-and display all the nodes in the list.

-Delete a node at a position in the list

In: Computer Science