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]
3 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]3 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
Which of the following tasks is the project manager least likely to be involved in?
user100 [1]

Answer:

i think its d sorry if i am wrong

3 0
3 years ago
Read 2 more answers
Write a program in python to accept three numbers and print the largest of the three
Anika [276]

Answer:

num1 = int(input("Enter number 1: "))

num2 = int(input("Enter number 2: "))

num3 = int(input("Enter number 3: "))

print(max(num1,num2,num3))

Explanation:

Python 3

8 0
3 years ago
Which camera does Angelina use?
julia-pushkina [17]

Answer:

mirrorless cameras have lot more space due to not having mirrors. and they have the same or better quality than DSLR's.

8 0
3 years ago
I have an IPhone 8plus 64gb... should I get another phone like samsung note 9 or s9 ??
laiz [17]

Nah, I think the IPhone would be better than them both


7 0
3 years ago
Your eighty-three-year-old grandmother has been using a computer for some time now. As a way to keep in touch, you frequently se
Sergeu [11.5K]

Answer:

Cultural lag

Explanation:

Cultural lag is a situation where by a society experiences technological development at a rate faster than the development that occurs in culture and general way of life.

A very good example is that it takes a longtime before cultural development can match up with technological developments and advancements thus leading to social problems due to lag. The cultural lag theory was formed in 1922 by William F Ogburn a sociologist.

3 0
3 years ago
Other questions:
  • Encryption is the process of:
    12·1 answer
  • Which finger types the highlighted keys on a number keypad? A. Third B. First C. Pinky D. Thumb
    7·2 answers
  • During active listening, which response is NOT an example of providing feedback to the speaker to show that you understand his o
    15·1 answer
  • How to get the absolute value in coding begginners?
    13·2 answers
  • Does anyone know the answers to the AR test on Gathering Blue by Lois Lowery?
    10·1 answer
  • Write a program whose input is two integers. Output the first integer and subsequent increments of 5 as long as the value is les
    8·1 answer
  • Write a program with 2 separate functions which compute the GCD (Greatest Common Denominator) and the LCM (Lowest Common Multipl
    9·1 answer
  • 7.4 Lesson Practice (projectstem): what is output if the user is enters 2?​
    8·1 answer
  • How long will the plant have been dead when 87.5 percent of its C-14 has become N-14?
    5·1 answer
  • If your computer determines the destination address of a network packet is to a remote network.
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!