Question: public static void main(String args[]) throws IOException { Scanner scanner = new Scanner(new File(D:/RAMerrors.txt)); String result; Double decimal; while (scanner.hasNextLine()) { String line = scanner.nextLine();
public static void main(String args[]) throws IOException {
Scanner scanner = new Scanner(new File("D:/RAMerrors.txt")); String result; Double decimal;
while (scanner.hasNextLine()) { String line = scanner.nextLine(); Scanner input = new Scanner(line); String hex = input.next(); result = hexToBinary(hex); System.out.println("Binary of " + hex + ":" + result); decimal = binaryToDecimal(result); System.out.println("Decimal value: " + decimal); } }
I want to change the system.out.prinln into a system.out.printf, can't figure it out.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
