/************************************************
*	Eddie Corrales		3/25/07	        *
*	Prof. Bam 		EC337Pennies4   *
*       Java                                    *
*************************************************/

import java.text.DecimalFormat;
import java.util.Scanner;


public class EC337Pennies4
{
public static void main(String[] args)
{
// delcare variables
	double Pennies = 0.01;
	String name;
	int Days;
// create scanner and decimal format
	Scanner Empire = new Scanner (System.in);
	DecimalFormat dollar = new DecimalFormat("#,##0.00");

// Enter name
	System.out.println("Enter the person's name:");
	name = Empire.nextLine();

//Enter the amount of days worked
	System.out.println("Enter the amount of days you worked");
	Days = Empire.nextInt();

//To see if the number of days worked is more than 1
	while(Days < 1 )
	{
	System.out.println("Sorry But your days worked has to be greater than Zero");
	Days = Empire.nextInt();
	}

	System.out.println("");
	System.out.println("***Salary each day*** \n\n");

//calc the amount of money earned
	while (Days >= 1)
	{

	Pennies = Pennies * 2;

	System.out.println("$" + dollar.format(Pennies));
	Days--;
	}
//Displays the Total
	System.out.println("");
	System.out.println("*** Total Salary *** \n\n");
	System.out.println(name + "'s" + " total salary is $" + dollar.format(Pennies));
	System.out.println("");
	System.out.println("");
	System.out.println("");
}
}

