Answered step by step
Verified Expert Solution
Question
1 Approved Answer
JAVA LANGUAGE!! OUTPUT/INPUT MUST BE EXACTLY THE SAME. John goes to a bakery to buy cookies and tries to calculate the shortfall if the current
JAVA LANGUAGE!! OUTPUT/INPUT MUST BE EXACTLY THE SAME.
John goes to a bakery to buy cookies and tries to calculate the shortfall if the current money is not enough. The price of one cookie is K, the number of cookies to buy is N, and the current amount of money is M. If he calculates the shortfall (s), his mother will pay the money (shortfall) For example, the price of one cookie is $3, the number of cookies bought is 4, When he has $10, the money he needs is $2. If the price of one cookie is $2.50, the number of cookies to buy is 2, and he has $1.50, the money that his mother has to pay is $3.50. If the price of one cookie is $0.20, the number of sweets to buy is 6, and he has $1.50, the money he needs from his mother is $O Input & Output Format T-the number of test case K = the price of ne c kle N -the number of cookie M = the amount of money John has s -the amount of money he will ask his mother to pay (K, N, and M are non-negative) Input K N M Output Example Input 30.00 4 100.00 2.50 2 1.40 2.00 6 12.00 Output 20.00 3.60 0.00Step 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