Q1: Output a welcome message to the console. The message should be contained inside of a string variable that is accessible by the entire program via it's scope.   Q2: Create a conditional statement that outputs the grade of a student based on their mark. You may use an IF or a SWITCH. I'll get you started. var grade; var mark = 94; // ... console.log("The student received an " + grade + " in the course!");    Q3: This the following 4 lines of code has a bug and doesn't add correctly. Find the bug and fix it so the output is correct. Add comments to show that you've corrected the bug appropriately. var y = "4"; var x = 20;   var total = x + y; console.log(x + " + " + y + " = " + total);

Programming Logic & Design Comprehensive
9th Edition
ISBN:9781337669405
Author:FARRELL
Publisher:FARRELL
Chapter8: Advanced Data Handling Concepts
Section: Chapter Questions
Problem 1GZ
icon
Related questions
icon
Concept explainers
Question
100%

Q1: Output a welcome message to the console. The message should be contained inside of a string variable that is accessible by the entire program via it's scope.

 

Q2: Create a conditional statement that outputs the grade of a student based on their mark. You may use an IF or a SWITCH. I'll get you started.

var grade;

var mark = 94;

// ...

console.log("The student received an " + grade + " in the course!");

 

 Q3: This the following 4 lines of code has a bug and doesn't add correctly. Find the bug and fix it so the output is correct. Add comments to show that you've corrected the bug appropriately.

var y = "4";

var x = 20;

 

var total = x + y;

console.log(x + " + " + y + " = " + total);

 

Expert Solution
steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Knowledge Booster
Control Structure
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Programming Logic & Design Comprehensive
Programming Logic & Design Comprehensive
Computer Science
ISBN:
9781337669405
Author:
FARRELL
Publisher:
Cengage