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, 23.06.2019 01:00
Let r be a robotic arm with a fixed base and seven links. the last joint of r is a prismatic joint, the other ones are revolute joints. give a set of parameters that determines a placement of r. what is the dimension of the configuration space resulting from your choice of parameters?
Answers: 3
question
Computers and Technology, 23.06.2019 05:00
Jason works as an accountant in a department store. he needs to keep a daily record of all the invoices issued by the store. which file naming convention would him the most?
Answers: 2
question
Computers and Technology, 23.06.2019 23:30
Perform an online search about the booting process of a computer and list all the steps
Answers: 2
question
Computers and Technology, 24.06.2019 12:00
What is a sketch or blueprint of a web page that shows the structure (but not the detailed design) of basic page elements such as the logo, navigation, content, and footer?
Answers: 3
You know the right answer?
JavaCalculate the ChangeProgramming challenge description:The goal of this question is to design a c...
Questions
question
Mathematics, 22.01.2020 23:31
question
Mathematics, 22.01.2020 23:31
question
Chemistry, 22.01.2020 23:31
question
Mathematics, 22.01.2020 23:31
Questions on the website: 13722363