Write a program which will demonstrate how to format output. To formatdata is topresent it in a certain way.The same data can be formattedin many ways, someof them easy forusers to understand, and some of them not.
This program should be an example ofhow Java lets you format numbers and
strings.First you will need to study Java's formatting facilities, and then write a
program which shows the contents of variables being printed with different widths,
precisions, andalignments. Your program should:
a) Print out the resultof dividing2400by 7,rounded off to 0,1, 2,and 3 decimalplaces.
b) Print out the result of dividing 2400 by 24.
c) Show how wecan left-justify acolumn of several rows of names, and then how we can right justify them.