subject

JavaCalculate the ChangeProgramming challenge description:The goal of this question is to design a cash register program. Your register currently has the following notes/coins within it:One Pence: .01Two Pence: .02Five Pence: .05Ten Pence: .10Twenty Pence: .20Fifty Pence: .50One Pound: 1Two Pounds: 2Five Pounds: 5Ten Pounds: 10Twenty Pounds: 20Fifty Pounds: 50The aim of the program is to calculate the change that has to be returned to the customer with the least number of coins/notes. Note that the expectation is to have an object-oriented solution - think about creating classes for better reusability. Input:Your program should read lines of text from standard input (this is already part of the initial template). Each line contains two numbers which are separated by a semicolon. The first is the Purchase price (PP) and the second is the cash(CH) given by the customer. Output:For each line of input print a single line to standard output which is the change to be returned to the customer. If CH == PP, print out Zero. If CH > PP, print the amount that needs to be returned (in terms of the currency values). Any other case where the result is an error, the output should be ERROR. The output should change from highest to lowest denomination. Test 1Test 1 Input11.2520Expected OutputFive Pounds, Two Pounds, One Pound, Fifty Pence, Twenty Pence, Five PenceTest 2Test 2 Input8.7550Expected OutputTwenty Pounds, Twenty Pounds, One Pound, Twenty Pence, Five PenceTest 3Test InputDownload Test 3 Input2010Expected OutputDownload Test 3 InputERRORCode below:please fill the functions and or classes here. thank you for help. import java. io. BufferedReader;import java. io. IOException;import java. io. InputStreamReader;import java. nio. charset. StandardCharsets;public class Main {/*** Iterate through each line of input.*/public static void main(String[] args) throws IOException {InputStreamReader reader = new InputStreamReader(System. in);BufferedReader in = new BufferedReader(reader);try {double purchasePrice = Double. parseDouble(in. readLine());double cash = Double. parseDouble(in. readLine());Main. calculateChange(purchasePrice, cash);} catch (Exception e) {System. out. println(e);}}public static void calculateChange(double purchasePrice, double cash) {// Access your code here. Feel free to create other classes as required}}

ansver
Answers: 3

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 22:30
I'll mark brainliest if answered right! with which feature or menu option of a word processing program can you make an image like this? you can get this image using the option of a word processing program.
Answers: 1
question
Computers and Technology, 23.06.2019 09:00
Which best describes the role or restriction enzymes in the analysis of edna a. to break dna into fragments that vary in size so they can be sorted and analyzed b. to amplify small amounts of dna and generate large amounts of dna for analysis c. to purify samples of dna obtained from the environment so they can be analyzed d. to sort different sizes of dna fragments into a banding pattern that can be analyzed
Answers: 1
question
Computers and Technology, 23.06.2019 11:00
How should you specify box sizes on a web page if you want the boxes to vary according to the font size of the text they contain? a. in pixels b. in inches c. as percentages d. in em units
Answers: 2
question
Computers and Technology, 24.06.2019 02:30
How to apply the fly in effect to objects on a slide
Answers: 1
You know the right answer?
JavaCalculate the ChangeProgramming challenge description:The goal of this question is to design a c...
Questions
question
Advanced Placement (AP), 20.06.2020 18:57
question
Mathematics, 20.06.2020 18:57
question
Mathematics, 20.06.2020 18:57
question
Mathematics, 20.06.2020 18:57
Questions on the website: 13722367