Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribedJAVA 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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

C++ Database Development

Authors: Al Stevens

1st Edition

1558283579, 978-1558283572

More Books

Students also viewed these Databases questions

Question

Why is Nasdaq so important to the success of the OTC market?

Answered: 1 week ago

Question

Define Administration?

Answered: 1 week ago