Consider the following method 1.double calculateBill(int usage){ 2. double bill = 0; 3. if (usage > 0){ 4. b

Business, Finance, Economics, Accounting, Operations Management, Computer Science, Electrical Engineering, Mechanical Engineering, Civil Engineering, Chemical Engineering, Algebra, Precalculus, Statistics and Probabilty, Advanced Math, Physics, Chemistry, Biology, Nursing, Psychology, Certifications, Tests, Prep, and more.
Post Reply
answerhappygod
Site Admin
Posts: 899603
Joined: Mon Aug 02, 2021 8:13 am

Consider the following method 1.double calculateBill(int usage){ 2. double bill = 0; 3. if (usage > 0){ 4. b

Post by answerhappygod »

Consider the following method
1.double calculateBill(int usage){2. double bill = 0;3. if (usage > 0){4. bill = 40;5. }6. if (usage > 100){7. if (usage <= 200){8. bill += (usage–100) *0.5;9. }10. else{11. bill += 50+(usage-200) *0.1;12. if (bill >= 100){13. bill = bill *0.9;14. }15 }16. return bill;17. }
Select all the statements that are true
(4,8) is a DU pair for "bill"
(1,4) is a DU pair for "usage"
The use of "bill" in line 13 is a p-use
(12,13) is a DU pair for "bill"
The use of "usage" in line 8 is a c-use
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply