71.9k views
3 votes
Online Book Merchants offers premium customers 1 free book with every purchase of 5 or more books and offers 2 free books with every purchase of 8 or more books. It offers regular customers 1 free book with every purchase of 7 or more books, and offers 2 free books with every purchase of 12 or more books.Write a statement that assigns freeBooks the appropriate value based on the values of the bool variable isPremiumCustomer and the int variable nbooksPurchased .I triedif (isPremiumCustomer==true){if (nbooksPurchased >= 5){freeBooks==1;{if (nbooksPurchased >= 8){freeBooks==2;}}}}else if (isPremiumCustomer==false){if (nbooksPurchased >= 7){freeBooks==1;{if (nbooksPurchased >= 12){freeBooks==2;}}}}but the system said:Remarks: ? At ExecutionProblems Detected: ? The value of freeBooks is incorrect. ? You did not assign a value to freeBooksand this one ......Write a loop that reads strings from standard input where the string is either "duck" or "goose". The loop terminates when "goose" is read in. After the loop, your code should print out the number of "duck" strings that were read.

User Staros
by
4.8k points

1 Answer

4 votes

Answer:

8/9

Step-by-step explanation:

i remember this question on my daughters book

User Camon
by
5.0k points