What are the possible values of z after running the following code? x = Math.floor(Math.random()*2)*2-1; y = Math.random

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

What are the possible values of z after running the following code? x = Math.floor(Math.random()*2)*2-1; y = Math.random

Post by answerhappygod »

What are the possible values of z after running the following
code?
x = Math.floor(Math.random()*2)*2-1;
y = Math.random();
z = x*(y+2);
Group of answer choices
z is a floating-point number such that -3<z≤-2 or 2≤z<3,
i.e., zϵ]-3, -2]⋃[2, 3[
z is an integer such that zϵ{-3, -2, 2, 3}
z is an integer such that zϵ{-3, -2, -1, 0, 1, 2, 3}
z is a floating-point number such that -3<z<3, i.e.,
zϵ]-3, 3[
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply