(Solved):Write a program that prompts the user for a file name, assuming that the file contains a Java program. Your program should read the file and print its contents properly indented. When you see a lef… View Answer…

 

Question

Write a program that prompts the user for a file name, assuming that the file contains a Java program. Your program should read the file and print its contents properly indented. When you see a left-brace character ({) in the file, increase your indentation level by four spaces. When you see a right-brace character (}), decrease your indentation by four spaces. You may assume that the file has only one

Scroll to top