/**************************************************
*	Eddie Corrales			3/25/07	              *
*	Prof. Bam 		        ECPay2                *
*	Project Java				                  *
*                                                 *
***************************************************/


import java.util.Scanner;
import java.io.*;





public class ECemployee
{

	public static Scanner entry = new Scanner(System.in);

	public static void main(String[] args)

	{


		int ID, code;
		String name;
		double hours, pay, total;
		Char Answer;

		System.out.print("Would you like to enter a new employee?(y or n): ");
		Answer.entry.nextChar();
		if(Answer == 'y')
				{
					say("Please enter the name of the employee");
					name = entry.nextLine();
					say("Please enter the employees ID number");
					ID = entry.nextInt();
					say ("Please enter the employees code");
					code = entry.nextInt();
					say("Please enter the pay of the new employee");
					pay = entry.nextDouble();
					while(pay < 0)
					{
						say("0 and below is in invalid payrate, please re-enter the value.");
						pay = entry.nextDouble();
					}
					say("Please enter the number of hours that the employee has worked");
					hours = entry.nextDouble();
					while(hours < 0)
					{
						say("Employee can not work negative hours");
						say("Please enter a valid number of hours, 0 is unacceptable");
						hours = entry.nextDouble();
					}
				}





		else
				{
								//end
				say("Thank you ");
				}

				ECpay2 e1;
				e1 = new ECpay2(hours, pay, code, total);


				say(name + e1.getcode() + " has a pay of " + e1.gettotal() +
				"this week and has worked " + e1.gethours() + " hours.");
	}


	//// I/O METHODS //
	public static void say( String s )	{  System.out.println( s );	}
	public static void say( int i )		{  System.out.println( i );	}
	public static void say( double d )	{  System.out.println( d );	}

	public static void saywhat( String s, int what )	{  say( s + what );	}
	public static void saywhat( String s, double what )	{  say( s + what );	}

	public static int askint( String prompt )
	{
		say( prompt + " " );		// NOTE:  Not println
		return entry.nextInt();
	}
	public static double askd( String prompt )
	{
		say( prompt + " " );
		return entry.nextDouble();
	}
	public static String asks( String prompt )
	{
		say( prompt + "..." );
		return entry.next();
	}



}

























































