Computer Science, asked by raghunathraj826, 4 months ago

In a company named Micky software solution, many part-time employees are working for a pay of Rs. 100 per hour. Write a program to calculate the total amount an employee earns in a year by working part time. Consider employees should work all day in the year and year has 365 days.

Answers

Answered by akromaticyash5
2

Answer:

In this example consider that every employee is getting $37.50 per hour and the standard hours per week is 40 hours/week. If any employee works more than 40 hours per week then he/she should be earning $2.50 additional per extra hour worked.

import java.util.Scanner;

public class SalaryCalculator {

   public static void main(String[] args) {

       System.out.print("Enter number of hours worked: ");

       Scanner in = new Scanner(System.in);

       double totalHoursWorked = in.nextInt();

       double standardWage = 37.50;

       int standardHours = 40;

       double totalWage;

       double overtimeBonus = 2.50;

       if (totalHoursWorked > 40)

           totalWage = (standardWage * totalHoursWorked)

                       + (totalHoursWorked - standardHours) * overtimeBonus;

       else if (totalHoursWorked < 40)

           totalWage = standardWage * totalHoursWorked;

       else

           totalWage = standardWage * standardHours;

       System.out.println("Your total salary of the week is: " + totalWage);

Explanation:

sry didn't get the ans but i'll hope this will help u...

Answered by palsaptaparni98
3

Answer:

import java.util.Scanner;

public class IncomeCal {

 public static void main(String[] args) {

     System.out.print("Enter number of hours worked: ");

     Scanner in = new Scanner(System.in);

     int totalHoursWorked = in.nextInt();

     int standardWage = 100;

 

     int totalWage=0;

     

     if (totalHoursWorked > =0 && totalHoursWorked<=24){

         totalWage += standardWage * totalHoursWorked *365;

         System.out.println("Your total salary of the week is: " + totalWage);

}

     else

         System.out.println("Unable to calculate the earning");

     

     

Explanation:

Hope it'll help you.

Similar questions