I need help on what java program will work...

October 11, 2010 at 05:44:48
Specs: Windows XP, 250MB
i was ask to input the employees name as well as his/her salary...and was asked to diplay the breakdown of the salary into thousand,5-hundred,2 hundred,hundred,50,20,10,5,1...components..I was asked to diplay the following output:
Input Name:
Input Salary:
More Entry? (Y/N):

if "N" is answered for the 3rd line,then the prog must display:

Denominations No. of Pieces Amount
1000
500
200
100
50
20
10
5
1
Total


pls help me


See More: I need help on what java program will work...

Report •

#1
November 25, 2010 at 09:46:17
import java.util.*;

public class Employee
{

public static void main(String[] args)
{

do
{

Scanner sc=new Scanner(System.in);

String EmpName;
int EmpSalary;
String Entry;
int Total;

System.out.println("Input Name: ");
EmpName=sc.next();
System.out.println("Input Salary: ");
EmpSalary=sc.nextInt();
System.out.println("More Entry? (Y/N): ");
Entry=sc.next();

if(Entry=Y)
{
}while(Entry="Y");
}
else if (Entry=N)
{
//arraylist goes here

System.out.println("Total: ");
Total=sc.nextInt();
}

}//ends main method

}//end of class

I recommend that you study arrays and array lists. Then put them into the class above where i said "array list goes here".
I hope this gives you somewhere to start and is some use.
If you are having problems with this email me:)


Report •
Related Solutions


Ask Question