Question: USING JAVA - below is the console class which needs to be used for the question. public class Console { public static Scanner console =

 USING JAVA - below is the console class which needs to

USING JAVA - below is the console class which needs to be used for the question.

public class Console { public static Scanner console = new Scanner(System.in); public static String askString(String aPrompt) // method for string input { System.out.print(aPrompt); // aPrompt is a request for string input String reply = console.nextLine(); // input held in a variable called reply return reply; } public static int askInt(String aPrompt) // method for integer input { String reply = askString(aPrompt); return Integer.parseInt(reply); // parseInt converts string to integer } public static double askDouble(String aPrompt) // method for double input { String reply = askString(aPrompt); return Double.parseDouble(reply); // parseDouble converts string to double } public static char askChar(String aChar) // method for one character input { String reply = askString(aChar); // Take first character of string and convert to Uppercase return Character.toUpperCase(reply.trim().charAt(0)); } }

please solve the question with the console java code above and solve as understandable as possible so I can understand how to do this for other questions. Steps would be great too! Thanks!

Create a class called Coins class to read an amount in pence. Work out the number of pound coins, 50 pence coins, 20 pence coins, 10 pence coins, 5 pence coins and 1 penny coins for amount entered

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!