The following code aims to ask the user to input 2 integers and then ask the user to input the sum of these 2 integers a

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

The following code aims to ask the user to input 2 integers and then ask the user to input the sum of these 2 integers a

Post by answerhappygod »

The following code aims to ask the user to input 2 integers and
then ask the user to input the sum of these 2 integers and check if
the user gets it right.
q = prompt("Enter the first integer");
r = prompt("Enter the second integer");
s = prompt("What is the sum of these 2 integers?");
if ( [Boolean Expression] )
alert("Right!");
else
alert("Wrong!");
What should be used as [Boolean Expression] in the above code?
Check all correct answers.
Group of answer choices
s = q+r
s == q+r
Number(s) = Number(q)+Number(r)
Number(s) == Number(q)+Number(r)
Number(s) == Number(q+r)
Number(q)+Number(r) == Number(s)
q+r == s
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply