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

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!