ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 9 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 26 Apr 2017 My Price 9.00

figure out what is the error in the follow Javescript code

I can not for the life of me figure out what is the error in the follow Javescript code.

 

function main()

{

   var highScore;

   var lowScore;

   

   var numExams = 5;

   var examArray = [];

   

   for (ctr = 0; ctr < numExams; ctr++)

   {

       examArray[ctr] = Number(prompt("Enter the score for exam " + ctr));

   }

   

   highScore = examArray[0];

   lowScore = examArray[0];

   

   for (ctr = 0; ctr < numExams; ctr++)

   {

       if (examArray[ctr] > highScore)

       {

           highScore = examArray[ctr];

       }

       else

       {

           lowScore = examArray[ctr];

       }

   }

   console.log("High score is " + highScore);

   console.log("low score is " + lowScore);

}

main();

Answers

(11)
Status NEW Posted 26 Apr 2017 01:04 AM My Price 9.00

-----------

Not Rated(0)