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
The ____ contains the computer's "brain," the central processing unit (CPU).
Vsevolod [243]
(not completely 100% sure) the Motherboard
6 0
4 years ago
Read 2 more answers
What is bandwidth? the speed at which data can be transferred from your wireless modem. a measurement of how much information ca
EleoNora [17]
<span>Bandwith is a measurement of the amount of data that can be up or downloaded at a give time, generally measured in seconds, over either a wireless or wired communication link.</span>
3 0
4 years ago
Who are the founders of the video-sharing site Blip?
rewona [7]

the Founders would be Justin Day


3 0
3 years ago
Jayden wants to take a current theme but just change a little bit of it. Complete the steps to help Jayden.
Sindrei [870]

Answer:The theme can be automatically changed via the default settings

Explanation:

4 0
3 years ago
What is one step taken when solving a computer software problem?
alexandr1967 [171]
Scanning the computer and deleting any viruses

[ if this helped you please give brainliest :) ]
3 0
3 years ago
Other questions:
  • Describe the importance of prioritizing your focus when designing for multiple purpose
    9·1 answer
  • A user reports that he can't connect to a specific website. you go to the user's computer and reproduce the problem. what should
    11·1 answer
  • The more critical a component or service, the higher the level of availability required. True False
    5·1 answer
  • Why shouldn't a server use a glass to scoop ice?
    6·2 answers
  • PLEASEEEEEEEEEEEEEEEEE HELPPPPPPPP
    15·1 answer
  • COMPUTER SCIENCE:PIXELS
    5·1 answer
  • Assemble a Server computer based on your budget (state the amount in Ghana Cedis), discussing the type of components (giving the
    11·1 answer
  • Why are there problems with patching electronics such as heart rate monitors and MRI machines that run embedded Windows OSs?
    14·1 answer
  • MSWord is a popular___________ program.​
    7·2 answers
  • True or false: Concurrent validation is more time consuming to measure than predictive validation because it involves a wait per
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!