Question: Here is a code fragment which appears in a valid main(): int numGifts; double costPerGift; // numGifts gets a value somehow in code that is
Here is a code fragment which appears in a valid main(): int numGifts; double costPerGift; // numGifts gets a value somehow in code that is not shown. then ... if ( numGifts <= 10 ) costPerGift = 3.0; else if ( numGifts <= 20 ) costPerGift = 2.75; else costPerGift = 2.5; For which values of numGifts will costPerGift be 2.75 at the end of the fragment? (Check all boxes that apply - there will be more than one.)
numGifts = 11
numGifts = 20
numGifts = -1
numGifts = 8
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
