Question: A pretty print program takes a program that may not be indented in any particular way and produces a copy with the same program indented
A pretty print program takes a program that may not be indented in any particular way and produces a copy with the same program indented so that bracket pairs ({ and }) line up with inner pairs indented more than outer pairs (as we have been doing throughout the book). Write a program that reads a Java program from one text file and produces a pretty print version of the program in a second text file. To make it easier, simply do this for each method, ignoring the things outside of the methods.
Step by Step Solution
3.40 Rating (172 Votes )
There are 3 Steps involved in it
To write a program to pretty print a Java program you will need to do the following Read in the Java program from the input file Use a stack to track ... View full answer
Get step-by-step solutions from verified subject matter experts
