write a payroll program that prompt a user to Enter his name, hourly rate, working hours in the week and display the amount earning by each employee in Rand.
Note: User is not allowed to enter any negative value for hourly rate and working hours.
1
Expert's answer
2012-05-11T08:36:27-0400
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
Scanner in = new Scanner(System.in);
System.out.println("Please, enter your name");
String name = in.nextLine();
System.out.println("Please, enter your hourly rate");
double rate = in.nextDouble();
while(rate <= 0){
System.out.println("Please, enter your hourly rate");
rate = in.nextDouble();
}
System.out.println("Please, enter your working hours in the week");
int hours = in.nextInt();
while(hours <= 0){
System.out.println("Please, enter your working hours in the week");
Numbers and figures are an essential part of our world, necessary for almost everything we do every day. As important…
APPROVED BY CLIENTS
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments
Leave a comment