Question: PLEASE WRITE IN ECLIPSE! 1 import java.util.Scanner; Problem Statement ohn wants to buy the costliest gifts for all the kids during the Christmas party. The


1 import java.util.Scanner; Problem Statement ohn wants to buy the costliest gifts for all the kids during the Christmas party. The stock availability of gifts in the store and the number of kids are given. Write a program to print the amount required to buy the gifts. Print 0 if enough stock doesn't exist. Please note John can buy any one of the gifts not a combination gifts. That means the same gifts have to be given to all the kids Input Format: First-line contains the number of kids ' N ' and the second line contains the gift stock availability details ' S ' in the format giftname:price:quantityavailable separated by a comma. Reading these two inputs from the standard input stream is already provided. Output Format: Print the amount required by John to buy the most expensive gift. Print 0 if there isn't enough stock(i.e. Quantity Available of each gift
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
