As you see in PhoneCharge.java, the total charge needs to be printed on the screen so we know the result. As a matter of fact, any program has to generate some results - the output. Sometimes the output is data, sometimes the output is a pattern like a Christmas tree.
B. Did you notice System.out.println() is a function(method) call?
So, basically you call the output function print out what you want to
System.out.print() is another function(method) which print on the same line
System.out.printf() is yet another function(method) which allows you to "format" the output. For instance, System.out.printf("%.2f", Math.PI) prints Pi value with two decimal places.
Did you print out a Christmas tree? Can you put some ornaments on it?
Can you find out more about System.out.printf() ?
Write a program that prints an animal speaking a greeting, similar to (but different from) the following. Notice to print '\', you need to enter '\\'. Learn more about escape sequences here.
/\_/\ ----- ( ' ' ) / Hello \ ( - ) < Junior | | | | \ Coder!/ (__|__) -----