import java.math.BigInteger;
import java.util.Calendar;
import java.util.Date;
@author
public class OutputTest {
@paramargs
public static void main(String[] args) {
String word = "Information";
int integer = 24;
double real = 12*Math.PI;
BigInteger bigInt = new BigInteger("123456789012345678901234567890123456789012345678901234567890");
Date today = Calendar.getInstance().getTime();
System.out.printf("String output tests:\n");
System.out.printf("A string-------------------------------|%s|\n", word);
System.out.printf("An upper-case string-------------------|%^s|\n", word);
System.out.printf("A string in 15 spaces------------------|%15s|\n", word);
System.out.printf("A string left justified in 15 spaces---|%-15s|\n", word);
System.out.printf("A string within 5 characters-----------|%.5s|\n", word);
System.out.printf("A string in a space of 5 to 7 chars----|%5.7s|\n", word);
System.out.printf("\n");
System.out.printf("Integer output tests:\n");
System.out.printf("An integer-----------------------------|%d|\n", integer);
System.out.printf("An integer as an octal-----------------|%o|\n", integer);
System.out.printf("An integer as hex----------------------|%x|\n", integer);
System.out.printf("\n");
System.out.printf("Double output tests:\n");
System.out.printf("A double-------------------------------|%f|\n", real);
System.out.printf("A double in scientific notation--------|%e|\n", real);
System.out.printf("A double with precision of 2-----------|%.2f|\n", real);
System.out.printf("A double with precision of 10----------|%.10f|\n", real);
System.out.printf("A double as a hex number---------------|%a|\n", real);
System.out.printf("\n");
System.out.printf("BigInteger output test:\n");
System.out.printf("A BigInteger---------------------------|%d|\n", bigInt);
System.out.printf("\n");
System.out.printf("Date output tests:\n"); System.out.printf("A Date object as a string--------------|%s|\n", today);
System.out.printf("A formatted Date object----------------|%tc|\n", today);
System.out.printf("An ISO8602 format Date object----------|%tF|\n", today);
System.out.printf("Time in 12 hour format ----------------|%tr|\n", today);
System.out.printf("Time in 24 hour format-----------------|%tR|\n", today);
System.out.printf("Time in 24 hour format w/ seconds -----|%tT|\n", today);
System.out.printf("Date-----------------------------------|%tD|\n", today);
System.out.printf("\n");
System.out.printf("Multiple Argument tests:\n");
System.out.printf("%1$s %2$d, %1$s %3$d, %1$s %4$d\n", "label", 1, 2, 3);
System.out.printf("Date mmddyyyy--------------------------|%1$tm%1$td%1$tY|\n", today);
}
}