September 2011
Beginner
650 pages
15h 47m
English
Try This 1-2 Improving the Gallons-to-Liters Converter
GalToLitTable.java
You can use the for loop, the if statement, and code blocks to create an improved version of the gallons-to-liters converter that you developed in the first project. This new version will print a table of conversions, beginning with 1 gallon and ending at 100 gallons. After every 10 gallons, a blank line will be output. This is accomplished through the use of a variable called counter that counts the number of lines that have been output. Pay special attention to its use.
1. Create a new file called GalToLitTable.java.
2. Enter the following program into the file:

3. Compile ...
Read now
Unlock full access