Ask Question

What would be the value of bonus after the following statements are executed? int bonus, sales = 1250; if (sales > 1000) bonus = 100; if (sales > 750) bonus = 50; if (sales > 500) bonus = 25; else bonus = 0;

+1
Answers (1)
  1. 24 November, 23:49
    0
    100

    Explanation:

    The statement uses a several if statements to check the variable sales and determine the amount of bonus.

    The first if statement assigns the the value of 100 to bonus if sales is greater than 1000. if (sales > 1000) bonus = 100;

    Since sales has been assigned the value of 1250, sales = 1250; then this condition is true and the value of bonus becomes 100.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “What would be the value of bonus after the following statements are executed? int bonus, sales = 1250; if (sales > 1000) bonus = 100; if ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers