Question: P1. For the code below, determine the output from the code #inc lude using namespace std; int main( ) { int numApples(5), num0ranges(10), numBananas (12)

 P1. For the code below, determine the output from the code

P1. For the code below, determine the output from the code \#inc lude using namespace std; int main( ) \{ int numApples(5), num0ranges(10), numBananas (12) ; double costPerApple(0.1), costPerorange(0.25), costPerBanana(0.05); bool isAppleRotten(true), isorangeRotten(false), isBananaRotten(false); double myCost(0.); if (isAppleRotten && num0ranges >=10 ) \{ if (! isorangeRotten) myCost += num0ranges costPerorange; else if (! isBananaRotten) myCost += numBananas * costPerBanana; else myCost += costPerApple numApples; \} if (! isBananaRotten) myCost +=( numBananas - 2) costPerBanana; cout "What I have to pay =\( =\$ " \ll \)quot; myCost endl; return 0 \}

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!