SlideShare a Scribd company logo
1 of 2
Download to read offline
var min =0;
var max=10;
var tab = {};
var name;
var score;
var sum=0;
while(name=prompt("Enter name:")){ // Get userinput for name
do{
score = prompt("Enter score"); // Get Score
tab[name] = score; // Create object with name as key and score as value.
}while(isNaN(score) || !(score>min) || !(score";
for(item in tab){ // Create table
ui = ui + (""+item+""+tab[item]+"");
sum = sum + parseInt(tab[item]);
}
ui = ui + "";
document.write(ui); // Display table
document.write("Average:"+(sum/Object.keys(tab).length).toFixed(2)); // Finding average and
displaying on the page
Solution
var min =0;
var max=10;
var tab = {};
var name;
var score;
var sum=0;
while(name=prompt("Enter name:")){ // Get userinput for name
do{
score = prompt("Enter score"); // Get Score
tab[name] = score; // Create object with name as key and score as value.
}while(isNaN(score) || !(score>min) || !(score";
for(item in tab){ // Create table
ui = ui + (""+item+""+tab[item]+"");
sum = sum + parseInt(tab[item]);
}
ui = ui + "";
document.write(ui); // Display table
document.write("Average:"+(sum/Object.keys(tab).length).toFixed(2)); // Finding average and
displaying on the page

More Related Content

More from aquastore223

The molecular orbital (MO) theory is a way of loo.pdf
                     The molecular orbital (MO) theory is a way of loo.pdf                     The molecular orbital (MO) theory is a way of loo.pdf
The molecular orbital (MO) theory is a way of loo.pdf
aquastore223
 
Unfortunately several cancers are not predictable with simple tests .pdf
Unfortunately several cancers are not predictable with simple tests .pdfUnfortunately several cancers are not predictable with simple tests .pdf
Unfortunately several cancers are not predictable with simple tests .pdf
aquastore223
 
The van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdf
The van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdfThe van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdf
The van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdf
aquastore223
 
Polar Bonds and Molecular Shape A polar molecule.pdf
                     Polar Bonds and Molecular Shape  A polar molecule.pdf                     Polar Bonds and Molecular Shape  A polar molecule.pdf
Polar Bonds and Molecular Shape A polar molecule.pdf
aquastore223
 
The good functioning of an economy depends on the proper functioning.pdf
The good functioning of an economy depends on the proper functioning.pdfThe good functioning of an economy depends on the proper functioning.pdf
The good functioning of an economy depends on the proper functioning.pdf
aquastore223
 
Stegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdf
Stegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdfStegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdf
Stegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdf
aquastore223
 
Tests of Controls in an Audit of Internal Control. The objective of .pdf
Tests of Controls in an Audit of Internal Control. The objective of .pdfTests of Controls in an Audit of Internal Control. The objective of .pdf
Tests of Controls in an Audit of Internal Control. The objective of .pdf
aquastore223
 
Software Quality Assurance is important because Quality in the softw.pdf
Software Quality Assurance is important because Quality in the softw.pdfSoftware Quality Assurance is important because Quality in the softw.pdf
Software Quality Assurance is important because Quality in the softw.pdf
aquastore223
 
Normal Concept For colour vision, our normal human eyes have 3 con.pdf
Normal Concept  For colour vision, our normal human eyes have 3 con.pdfNormal Concept  For colour vision, our normal human eyes have 3 con.pdf
Normal Concept For colour vision, our normal human eyes have 3 con.pdf
aquastore223
 
LinkedListOperations.java-class Node{    public int item;  .pdf
LinkedListOperations.java-class Node{    public int item;  .pdfLinkedListOperations.java-class Node{    public int item;  .pdf
LinkedListOperations.java-class Node{    public int item;  .pdf
aquastore223
 
In Keynesian economic theory, a factor that quantifies the change in.pdf
In Keynesian economic theory, a factor that quantifies the change in.pdfIn Keynesian economic theory, a factor that quantifies the change in.pdf
In Keynesian economic theory, a factor that quantifies the change in.pdf
aquastore223
 
import java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdfimport java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdf
aquastore223
 
Classical mechanics and quantum mechanics are sub.pdf
                     Classical mechanics and quantum mechanics are sub.pdf                     Classical mechanics and quantum mechanics are sub.pdf
Classical mechanics and quantum mechanics are sub.pdf
aquastore223
 

More from aquastore223 (20)

The molecular orbital (MO) theory is a way of loo.pdf
                     The molecular orbital (MO) theory is a way of loo.pdf                     The molecular orbital (MO) theory is a way of loo.pdf
The molecular orbital (MO) theory is a way of loo.pdf
 
The electrons reach or give off a certain amount of energy and diffe.pdf
  The electrons reach or give off a certain amount of energy and diffe.pdf  The electrons reach or give off a certain amount of energy and diffe.pdf
The electrons reach or give off a certain amount of energy and diffe.pdf
 
Weak London disperision and dipole- dipoleModerate Hydrogen bond.pdf
Weak London disperision and dipole- dipoleModerate Hydrogen bond.pdfWeak London disperision and dipole- dipoleModerate Hydrogen bond.pdf
Weak London disperision and dipole- dipoleModerate Hydrogen bond.pdf
 
Unfortunately several cancers are not predictable with simple tests .pdf
Unfortunately several cancers are not predictable with simple tests .pdfUnfortunately several cancers are not predictable with simple tests .pdf
Unfortunately several cancers are not predictable with simple tests .pdf
 
The van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdf
The van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdfThe van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdf
The van t Hoff factor i (named after J. H. van t Hoff) is a meas.pdf
 
Polar Bonds and Molecular Shape A polar molecule.pdf
                     Polar Bonds and Molecular Shape  A polar molecule.pdf                     Polar Bonds and Molecular Shape  A polar molecule.pdf
Polar Bonds and Molecular Shape A polar molecule.pdf
 
The good functioning of an economy depends on the proper functioning.pdf
The good functioning of an economy depends on the proper functioning.pdfThe good functioning of an economy depends on the proper functioning.pdf
The good functioning of an economy depends on the proper functioning.pdf
 
The answer is Yes, it is a reduction-oxidation reaction2 HNO2 + 2.pdf
The answer is Yes, it is a reduction-oxidation reaction2 HNO2 + 2.pdfThe answer is Yes, it is a reduction-oxidation reaction2 HNO2 + 2.pdf
The answer is Yes, it is a reduction-oxidation reaction2 HNO2 + 2.pdf
 
Stegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdf
Stegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdfStegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdf
Stegosaurus dinosaur belonged to the late jurassic period i.e Kimmer.pdf
 
The answer is d- the hydrogen bonds in iceThe high heat of fusion.pdf
The answer is d- the hydrogen bonds in iceThe high heat of fusion.pdfThe answer is d- the hydrogen bonds in iceThe high heat of fusion.pdf
The answer is d- the hydrogen bonds in iceThe high heat of fusion.pdf
 
SolutionOption (a) will qualify as a database as dictionary is a .pdf
SolutionOption (a) will qualify as a database as dictionary is a .pdfSolutionOption (a) will qualify as a database as dictionary is a .pdf
SolutionOption (a) will qualify as a database as dictionary is a .pdf
 
Tests of Controls in an Audit of Internal Control. The objective of .pdf
Tests of Controls in an Audit of Internal Control. The objective of .pdfTests of Controls in an Audit of Internal Control. The objective of .pdf
Tests of Controls in an Audit of Internal Control. The objective of .pdf
 
Software Quality Assurance is important because Quality in the softw.pdf
Software Quality Assurance is important because Quality in the softw.pdfSoftware Quality Assurance is important because Quality in the softw.pdf
Software Quality Assurance is important because Quality in the softw.pdf
 
Oxygen rich blood leaves the lungs. It travels via the pulmonary vei.pdf
Oxygen rich blood leaves the lungs. It travels via the pulmonary vei.pdfOxygen rich blood leaves the lungs. It travels via the pulmonary vei.pdf
Oxygen rich blood leaves the lungs. It travels via the pulmonary vei.pdf
 
Normal Concept For colour vision, our normal human eyes have 3 con.pdf
Normal Concept  For colour vision, our normal human eyes have 3 con.pdfNormal Concept  For colour vision, our normal human eyes have 3 con.pdf
Normal Concept For colour vision, our normal human eyes have 3 con.pdf
 
LinkedListOperations.java-class Node{    public int item;  .pdf
LinkedListOperations.java-class Node{    public int item;  .pdfLinkedListOperations.java-class Node{    public int item;  .pdf
LinkedListOperations.java-class Node{    public int item;  .pdf
 
In Keynesian economic theory, a factor that quantifies the change in.pdf
In Keynesian economic theory, a factor that quantifies the change in.pdfIn Keynesian economic theory, a factor that quantifies the change in.pdf
In Keynesian economic theory, a factor that quantifies the change in.pdf
 
import java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdfimport java.util.LinkedList; import java.util.Random; import jav.pdf
import java.util.LinkedList; import java.util.Random; import jav.pdf
 
Hi,Please find the answers as followsPart AExpec.pdf
Hi,Please find the answers as followsPart AExpec.pdfHi,Please find the answers as followsPart AExpec.pdf
Hi,Please find the answers as followsPart AExpec.pdf
 
Classical mechanics and quantum mechanics are sub.pdf
                     Classical mechanics and quantum mechanics are sub.pdf                     Classical mechanics and quantum mechanics are sub.pdf
Classical mechanics and quantum mechanics are sub.pdf
 

Recently uploaded

QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
httgc7rh9c
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
Elizabeth Walsh
 

Recently uploaded (20)

How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17How to Manage Call for Tendor in Odoo 17
How to Manage Call for Tendor in Odoo 17
 
REMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptxREMIFENTANIL: An Ultra short acting opioid.pptx
REMIFENTANIL: An Ultra short acting opioid.pptx
 
How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17How to Add New Custom Addons Path in Odoo 17
How to Add New Custom Addons Path in Odoo 17
 
Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17Model Attribute _rec_name in the Odoo 17
Model Attribute _rec_name in the Odoo 17
 
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdfUnit 3 Emotional Intelligence and Spiritual Intelligence.pdf
Unit 3 Emotional Intelligence and Spiritual Intelligence.pdf
 
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptxHMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
 
PANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptxPANDITA RAMABAI- Indian political thought GENDER.pptx
PANDITA RAMABAI- Indian political thought GENDER.pptx
 
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdfFICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
FICTIONAL SALESMAN/SALESMAN SNSW 2024.pdf
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lessonQUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
QUATER-1-PE-HEALTH-LC2- this is just a sample of unpacked lesson
 
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdfDiuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
Diuretic, Hypoglycemic and Limit test of Heavy metals and Arsenic.-1.pdf
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Ernest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell TollsErnest Hemingway's For Whom the Bell Tolls
Ernest Hemingway's For Whom the Bell Tolls
 
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...When Quality Assurance Meets Innovation in Higher Education - Report launch w...
When Quality Assurance Meets Innovation in Higher Education - Report launch w...
 
Understanding Accommodations and Modifications
Understanding  Accommodations and ModificationsUnderstanding  Accommodations and Modifications
Understanding Accommodations and Modifications
 
Orientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdfOrientation Canvas Course Presentation.pdf
Orientation Canvas Course Presentation.pdf
 
Towards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptxTowards a code of practice for AI in AT.pptx
Towards a code of practice for AI in AT.pptx
 
VAMOS CUIDAR DO NOSSO PLANETA! .
VAMOS CUIDAR DO NOSSO PLANETA!                    .VAMOS CUIDAR DO NOSSO PLANETA!                    .
VAMOS CUIDAR DO NOSSO PLANETA! .
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 

var min =0; var max=10; var tab = {}; var name; var score;.pdf

  • 1. var min =0; var max=10; var tab = {}; var name; var score; var sum=0; while(name=prompt("Enter name:")){ // Get userinput for name do{ score = prompt("Enter score"); // Get Score tab[name] = score; // Create object with name as key and score as value. }while(isNaN(score) || !(score>min) || !(score"; for(item in tab){ // Create table ui = ui + (""+item+""+tab[item]+""); sum = sum + parseInt(tab[item]); } ui = ui + ""; document.write(ui); // Display table document.write("Average:"+(sum/Object.keys(tab).length).toFixed(2)); // Finding average and displaying on the page Solution var min =0; var max=10; var tab = {}; var name; var score; var sum=0; while(name=prompt("Enter name:")){ // Get userinput for name do{ score = prompt("Enter score"); // Get Score tab[name] = score; // Create object with name as key and score as value. }while(isNaN(score) || !(score>min) || !(score"; for(item in tab){ // Create table ui = ui + (""+item+""+tab[item]+"");
  • 2. sum = sum + parseInt(tab[item]); } ui = ui + ""; document.write(ui); // Display table document.write("Average:"+(sum/Object.keys(tab).length).toFixed(2)); // Finding average and displaying on the page