Home /
Expert Answers /
Computer Science /
three-friends-want-to-order-a-pizza-together-the-pizza-store-offers-32-different-toppings-for-the-pa704
(Solved): Three friends want to order a pizza together. The pizza store offers 32 different toppings. For the ...
Three friends want to order a pizza together. The pizza store offers 32 different toppings. For the first friend, A, we have a set of bits, req_A (a 32-bit unsigned int), that represents their requirements--in other words, a "1" bit means that A will only eat the pizza if it has that topping. We also have a a set of bits, acc_A (another 32bit unsigned int), that represents toppings that are acceptable to A-in other words, a " 1 " bit means that A is willing to eat the pizza if it has that topping (and a "0" bit means that A is NOT willing). We also have analogous variables for each of the other two friends, B and C, so six variables in total. Which of the following code fragments identifies a combination of toppings that meets all three friends requirements and is acceptable to all of them? req =( req_A I req_B | req_C) acc = (acc_A \& acc_B \& acc_C) if (req =( req \& acc ) ) \{ \} else \{ \} (a) } else \{ req = (req_A ? req_B ? req_C) acc=( acc_A \& acc_B \& acc_c) if (req ==acc){
Which of the following code fragments identifies a combination of toppings that meets all three friends requirements and is acceptable to all of them?