Computer Science, asked by rmf14082006, 6 months ago

A security agency pays to their staff as per the tariff given below:
for the first 48 hours in a week Rs k per hour, for the next 8 hours in a week Rs 1.25k per hour, for the further hours in a week Rs 1.5k per hour. Write a java program to calculate the weekly wages of the satff taking number of hours and rate per hour as inputs. ​

Answers

Answered by mohdnumanuddin559
8

make me as a brainlist to wlview this answer

Answered by Anushkaphokane
0

Answer:

import java.util.Scanner;

public class q5

{

   public static void main(String args[]) {

       Scanner sc = new Scanner(System.in);

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

       int hr = sc.nextInt();

       double wage = 0;

       

       if (hr <= 48)  

       {

           wage = hr * 1000;

       }

       else if (hr <= 56) {

           wage = (48 * 1000) + ((hr - 48) * 1250);

       }

       else {

           wage = (48 * 1000) + (8 * 1250) + ((hr - 56) * 1500);

       }

       

       System.out.println("Weekly Wage = " + wage);

   }

}

Explanation:

Similar questions