Page 1 of 1

Ritika wants to buy a new laptop. However, she is confused about which laptop to buy out of 10 different laptops. She as

Posted: Tue May 24, 2022 8:18 am
by answerhappygod
Ritika Wants To Buy A New Laptop However She Is Confused About Which Laptop To Buy Out Of 10 Different Laptops She As 1
Ritika Wants To Buy A New Laptop However She Is Confused About Which Laptop To Buy Out Of 10 Different Laptops She As 1 (294.84 KiB) Viewed 13 times
use Java language
Ritika wants to buy a new laptop. However, she is confused about which laptop to buy out of 10 different laptops. She asks her N friends for their recommendation. The ith friend recommends her to buy the Ath laptop (1 ≤ A, ≤10). She will buy the laptop which is recommended by maximum number of friends. Formulate a program to determine which laptop she buys. If there are multiple laptops having maximum number of recommendations, that is, say laptop id 2 and 9 both have 3 votes then print confused. Sample input1: Laptop id 5 has 6 recommendations Sample Output1: Ritika buys laptop number 5. Sample input2: Laptop id 3, 4 and 7 each has 3 recommendations Sample Output2: Ritika is confused. [10M]