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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!