import java.util.Scanner;
/**********************************************************************
 * A main class.
 *
 * @version Jan 2009
 * @author  PUT YOUR NAME HERE
 *********************************************************************/

public class PrintfLab
{
	/**************************************************************
	 * Entry point to a program that uses different printf formats
	 * to display values.
	 *
	 * @param args Command line arguments - unused in this application
	 *************************************************************/
	public static void main (String args[])
	{
		int		ii;
		double	dd;
		String	ss;
		Scanner	keyboard;
		
		keyboard = new Scanner(System.in);

		//-------------------------------------------------------------
		// Input data.  The code does NOT verify the data received is in
		// the correct format.  That is ok for a "toy" program, but
		// "real" programs should verify input.
		//-------------------------------------------------------------
		System.out.printf ("Enter any string: ");
		ss = keyboard.nextLine();
		System.out.printf ("Enter any integer number: ");
		ii = keyboard.nextInt();
		System.out.printf ("Enter any double number: ");
		dd = keyboard.nextDouble();
		keyboard.nextLine(); // consume the new line character
		
		System.out.printf("\n");
		System.out.printf("PartA\n");
		System.out.printf ("The value ii==1: %b!\n", (ii == 1));
		System.out.printf ("The value ii!=1: %b!\n", (ii != 1));
		System.out.printf ("The value of ss: %s!\n", ss);
		System.out.printf ("The value of ss: %c!\n", ss.charAt(0));
		System.out.printf ("The value of ii: %d!\n", ii);
		System.out.printf ("The value of ii: %o(octal)!\n", ii);
		System.out.printf ("The value of ii: %x(hex)!\n", ii);
		System.out.printf ("The value of dd: %e!\n", dd);
		System.out.printf ("The value of dd: %E!\n", dd);
		System.out.printf ("The value of dd: %f!\n", dd);
		System.out.printf ("The value of dd: %g!\n", dd);
		System.out.printf ("Print a percent: %%!\n");
		System.out.printf ("The values are:  %s, %d, %f!\n", ss, ii, dd);

		//-------------------------------------------------------------
		// Add additional output statements here for Part B below.
		//-------------------------------------------------------------
		System.out.printf("\n");
		System.out.printf("PartB\n");

		//-------------------------------------------------------------
		// Add additional output statements here for Part C below.
		//-------------------------------------------------------------
		System.out.printf("\n");
		System.out.printf("PartC\n");
		
		//-------------------------------------------------------------
		// Add additional output statements here for Part D below.
		//-------------------------------------------------------------
		System.out.printf("\n");
		System.out.printf("PartD\n");
		
		//-------------------------------------------------------------
		// Add additional output statements here for Part E below.
		//-------------------------------------------------------------
		System.out.printf("\n");
		System.out.printf("PartE\n");
	}
}
