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

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

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

Post 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 12 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]
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!
Post Reply