231k views
2 votes
If the value of PctDec is -3.272, which statement will NOT return a value of -3 for Decrease?

a. Decrease=round(PctDec,1);
b. Decrease=ceil(PctDec);
c. Decrease=floor(PctDec);
d. Decrease=int(PctDec);

1 Answer

3 votes

Final answer:

The statement that will NOT return -3 for Decrease when PctDec is -3.272 is 'c. Decrease=floor(PctDec)'; which rounds down to -4.

Step-by-step explanation:

If the value of PctDec is -3.272, we're looking for the statement that will NOT return a value of -3 for Decrease. Let's evaluate each statement:

  • a. Decrease=round(PctDec,1); - This will round PctDec to one decimal place, which gives -3.3. When rounded to the nearest whole number, it becomes -3, so this statement returns -3.

  • b. Decrease=ceil(PctDec); - This will round PctDec up towards zero to the nearest whole number, which gives -3.

  • c. Decrease=floor(PctDec); - This will round PctDec down away from zero to the nearest whole number, which gives -4. So, this statement does NOT return -3.

  • d. Decrease=int(PctDec); - This will truncate PctDec to the integer part, which is -3.

So, the statement that will NOT return a value of -3 for Decrease is c. Decrease=floor(PctDec).

User RASEL RANA
by
8.6k points