Question
Assume the function getGrade(): function getGrade(score) { if (score >= 90.0) return 'A'; else if (score >= 80.0) return 'B'; else if (score >= 70.0)
Assume the function getGrade():
function getGrade(score) { if (score >= 90.0) return 'A'; else if (score >= 80.0) return 'B'; else if (score >= 70.0) return 'C'; else if (score >= 60.0) return 'D'; else return 'F'; } Provide the output when the next statements are executed: console.log("The grade is "); getGrade(78.5); console.log(" The grade is ");getGrade(59.5); Question options: The grade is 'C' The grade is 'F' The grade is 'B' The grade is 'D' The grade is 'C' The grade is 'F' The grade is 'C'
The grade is 'F' The grade is 'C' The grade is 'F'
_______________________________________________________
Given the following function nPrint(): function nPrint(message, n) { while (n > 0) { console.log(message); n--; } } What is the printout of the call: nPrint('a', 4); Question options: a a a a a a a invalid call a a a a a
_______________________________________________________
What is k after the following block executes? { int k = 2; nPrint("A message", k); } console.log(k); Question options: So, the program has a compile error. 1 0 2 _______________________________________________________
function myFunction1(a, b) { return a * b; } What is the output:
myObject = myFunction1.call(myObject, 10, 2); Question options: 2 10 20 The program does not compile.
______________________________________________________
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started