1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
dmitriy555 [2]
2 years ago
8

Develop a Java program that determines the gross pay for an employee. The company pays hourly rate for the first 40 hours worked

by the employee and time and a half (1.5x hourly rate) for all hours worked in excess of 40. The user of your application will enter an employee name, shift (day or night) ,the number of hours worked for the week and their hourly rate. Your program should then calculate and display the employee’s name, regular pay, overtime pay, total gross pay and payperiod. PayPeriod is "Friday" for "day" shift and "Saturday" for "night" shift. Use class Scanner to input the data. Be sure to format output, so it is professionally displayed to your users.Here is an example of pseudocode:StartEnter employee nameEnter employee shift (day/night)Enter hours workedEnter hourly pay rateCalculate reg payif hours worked > 40 thenCalculate overtime payelseovertime = 0Calculate total payOutput employee name, reguldar pay, overtime pay, total payIf day shiftoutput "Friday payperiod"Elseoutput "Saturday payperiod".End.
Computers and Technology
1 answer:
Neko [114]2 years ago
6 0

Answer:

// Program is implemented using Java Programming Language

// Comments are used for explanatory purpose

// The program starts here

import java.util.Scanner;

public class CalcRate

{

public static void main (String [] args)

{

//Call scanner function

Scanner input = new Scanner(System.in);

//Variable Declaration

int hour;

double regpay, overtime, total, hourlyrate;

string name,shift;

// Input employee details

System.out.print("What's your name: ");

name = input.nextLine();

System.out.print("What's your Shift: ");

shift = input.nextLine();

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

hour = input.nextInt();

System.out.print("What's your hourly pay rate: ");

hourlyrate = input.next.Double();

// Calculate worker's pay

if(hour<=40)

{

regpay = hourlyrate * hour;

overtime = 0;

}

else

{

overtime = (hour - 40) * 1.5 * hourlyrate;

regpay = 40 * hourlyrate;

}

total = regpay + overtime;

// Print payment details

System.out.println(" Employee name: "+name);

System.out.println(" Regular Pay: "+regpay);

System.out.println(" Overtime Pay: "+overtime);

System.out.println(" Total Pay: "+total);

// Print shift output

if(shift == "Day)

{

System.out.println(" Friday day period: ");

}

else

{

System.out.println(" Saturday day period: ");

}

}

}

You might be interested in
We can improve our knowledge and skills on animals and fish raising with the use of internet​
bagirrra123 [75]

Answer:

yeah that would be great

5 0
2 years ago
Which text features does this section contain? Check all that apply.
NISA [10]

which ones apply manuelh


6 0
3 years ago
When pointed over a text within a paragraph, the cursor takes the shape of a/an
Crank
I type of shape, or a pointing index finger
5 0
2 years ago
What is used in computers to communicate with wireless keyboards, mice, and printers?
vekshin1
Usb adapter -----------
5 0
3 years ago
Write a Python program to convert the characters to lowercase in a string
wel

Answer:

Following is the program in the python language

st = 'sAN RaN'  #String

print(st.lower()) #display into the lowercase

Output:

san ran

Explanation:

Following are the description of program

  • Declared and initialized the string in the "st" variable .
  • The lower function in python is used for converting the uppercase string into the lower case string .
  • Finally in the print function we used lower function and display the  string into the lower case
8 0
3 years ago
Other questions:
  • The Apple II is an IBM-compatible PC "clone".<br> True?<br> False?
    10·1 answer
  • Im being timed please help!!
    7·2 answers
  • I don't know the answer and I tried different ones and they not what the book is looking for.
    7·1 answer
  • Your boss is very skeptical about the idea of storing his files up in the cloud rather
    8·1 answer
  • What is one method that can be used to open the Microsoft Word application?
    8·1 answer
  • Consider the following method:
    14·1 answer
  • My phone takes forever to load the ads, does anyone else have this problem? Is there a way to fix it? I’ve tried getting another
    12·2 answers
  • What kind of skill is persuasion?
    7·1 answer
  • Out put of Print (3**2*2)
    13·2 answers
  • File names should be limited to 144 characters.<br><br> true or false
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!