Question: 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 aJAVA 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.00

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!