Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

JAVASCRIPT TASK URGENTTT Task 1: Students (1-students, 8 pts) The file index.js defines the array students which contains the following data about each student: their

JAVASCRIPT TASK URGENTTT

Task 1: Students (1-students, 8 pts)

The file index.js defines the array students which contains the following data about each student: their unique education code (code), their name (name) and the grades they've received on a course (grades). Some students may have a different number of grades than others due to their attendance, diligence and other extra work. Solve the following tasks using the array students. Technical help: use of array functions is recommended.

a. (2 pts) Output the name of the student whose code is xrpwmb to the element with ID task1.

b. (2 pts) Output the names of all students who received no grade other than 5 to the element with ID task2.

c. (2 pts) Output the number of students who failed (received at least three 1s) to the element with ID task3.

d. (2 pts) Output the name of the student who received the highest number of 1s to the element with ID task4.

index.js code needed to solve task

const task1 = document.querySelector('#task1');

const task2 = document.querySelector('#task2');

const task3 = document.querySelector('#task3');

const task4 = document.querySelector('#task4');

const students = [

{ "code": "xpzyom", "name": "Buck Oen", "grades": [4, 4, 2, 4, 4, 4, 4, 3] },

{ "code": "ollsxk", "name": "Rakel Hall", "grades": [2, 2, 2, 3, 3, 2] },

{ "code": "fcedpx", "name": "Adrianna Yosevitz", "grades": [1, 3, 3, 3, 4, 1] },

{ "code": "hughay", "name": "Kassi Blaxton", "grades": [3, 4, 5, 4, 5, 4, 2, 4, 5] },

{ "code": "tymclq", "name": "Merrili Hutchison", "grades": [5, 3, 2, 3, 2, 4] },

{ "code": "xrpwmb", "name": "Vittorio Eckhard", "grades": [5, 5, 5, 5, 5] },

{ "code": "tmkhgm", "name": "Jacobo Fidock", "grades": [1, 1, 4, 1, 1, 1, 2, 2] },

{ "code": "ltfwyu", "name": "Philip Roeby", "grades": [5, 5, 5, 5, 5, 5, 5, 5, 5] },

{ "code": "gpbqmb", "name": "Kakalina Geraldini", "grades": [5, 4, 3, 4, 5, 3, 5, 3, 3, 3] },

{ "code": "vimrfd", "name": "Sancho Hasty", "grades": [1, 2, 1, 1, 1, 3] }

];

// ========= Solution =========

// Hogy hvjk azt a dikot, akinek a kdja xrpwmb?

// What's the name of the student whose code is "xrpwmb"?

// Kik azok a dikok, akiknek csupa 5-sk van?

// Who are the students that received no grade other than 5?

// Hny olyan dik van, aki megbukott (legalbb 3 darab 1-ese van)?

// How many students have failed (received at least three 1s)?

// Ki kapta a legtbb egyest?

// Who received the highest number of 1s?

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Basics Computer EngineeringInformation Warehouse Basics From Science

Authors: Odiljon Jakbarov ,Anvarkhan Majidov

1st Edition

620675183X, 978-6206751830

More Books

Students also viewed these Databases questions