Sunday, December 26, 2021

Weekly Salary With Overtime in Java

  A simple program that I wrote in Python to solve the weekly wage of an employee in a company using Java programming language.

I am currently accepting programming work, IT projects, school and application development, programming projects, thesis and capstone projects, IT consulting work, computer tutorials, and web development work kindly contact me in the following email address for further details.  If you want to advertise on my website kindly contact me also in my email address also. Thank you.


My email address is the following jakerpomperada@gmail.com, jakerpomperada@aol.com, and jakerpomperada@yahoo.com.

My mobile number here in the Philippines is 09173084360.




Program Listing

import java.util.*;



 

public class WeeklySalary

{


//User Defined Method  to solve the weekly salary of the employee

public static double Solve_Weekly_Salary(double hours, double rate)  

{  


double wages;

if (hours > 40.0)

wages = 40.0 * rate +

1.5 * rate * (hours - 40.0);


else

wages = hours * rate;

return(wages);

}  


 

public static void main(String[] args)

{

Scanner console = new Scanner(System.in);

double solve_wages, rate, hours;

 

System.out.println("\n");

System.out.print("\tWeekly Salary With Overtime in Java");

System.out.println("\n");

System.out.print("Enter Hours Worked : ");

hours = console.nextDouble();

System.out.println();

 

System.out.print("Enter Phippine Peso(s) paid per hour : ");

rate = console.nextDouble();

System.out.println();

 

solve_wages = Solve_Weekly_Salary(hours,rate);

System.out.printf("Wages for %.2f hours at PHP %.2f per hour are PHP %.2f.",hours,rate,solve_wages);


System.out.println("\n");

System.out.println("End of Program");

System.out.println("\n");

console.close();

}

 

}




No comments:

Post a Comment