Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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
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 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
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started