Solution to Rewrite the following expressions using an if...else statement. (Assume that all variables are declared properly.) … - Sikademy
Author Image

Archangel Macsika

Rewrite the following expressions using an if...else statement. (Assume that all variables are declared properly.) a. (x < 5) ? y = 10 : y = 20; b. (fuel >= 10) ? drive = 150 : drive = 30; c. (booksBought >= 3) ? discount = 0.15 : discount = 0.0;

The Answer to the Question
is below this banner.

Can't find a solution anywhere?

NEED A FAST ANSWER TO ANY QUESTION OR ASSIGNMENT?

Get the Answers Now!

You will get a detailed answer to your question or assignment in the shortest time possible.

Here's the Solution to this Question


// a if (x < 5) { y = 10; } else { y = 20; } // b if (fuel >= 10) { drive = 150; } else { drive = 30; } // c if (booksBought >= 3) { discount = 0.15; } else { discount = 0.0; }

Related Answers

Was this answer helpful?

Join our Community to stay in the know

Get updates for similar and other helpful Answers

Question ID: mtid-3-stid-44-sqid-1064-qpid-60