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
What does an animation sequence action do?
OlgaM077 [116]

B) Plays an object's animation

An animation is a single drawing, cartoon, sketch, etc., but a sequence of animations can create movement, which appears to the viewer as the object or subject in motion.

3 0
3 years ago
Read 2 more answers
Bulleted and Numbered List button appear in the ………….. Toolbar.​
stich3 [128]

Answer:

The answer to this question is given below in the explanation section

Explanation:

Bulleted and Numbered List button appear in the <u>Paragraph </u>Toolbar.​

On word processing software, these options display in paragraph toolbar in the Home ribbon.

for example, in MS Word, you can find them in the Home tab under paragraph groups of command.

however, it is noted that these options are appear in some other software under the formating toolbar.

8 0
4 years ago
Which factor affects the gravitational force between two objects?
NNADVOKAT [17]
It depends on how far apart the 2 objects are from each other
7 0
3 years ago
What are demographics? (with regards to marketing)
skad [1K]
Demographics are different groups of people you would want to appeal to. Ex. Women, Americans, Mexicans, Men, and Children.

And as always have a wonderful day user!
3 0
3 years ago
Which option can Jesse use to customize her company’s logo, name, address, and similar details in all her business documents?
Rasek [7]
Are you talking about word processors? If yes, you can edit a document's header and footer so the change reflects on all pages of the document.
3 0
3 years ago
Other questions:
  • Consider the following relation:CAR_SALE(Car#, Date_sold, Salesperson#, Commission%, Discount_amt)Assume that a car may be sold
    12·1 answer
  • With only a floor plan to reference, the designer would know what about a window?
    7·1 answer
  • Which of the following functions grows at a faster rate than the rest? (Points : 6)
    12·1 answer
  • Which of the following would be a show stopper for the development of an enterprise mobile app? The app demands data throughput
    11·1 answer
  • What will be the result of running the following code fragment? int year = 0; double rate = 5; double principal = 10000; double
    14·1 answer
  • It's usually easier to change the design of a photo album slide show A.after you've created the presentation. B.before you've cr
    15·1 answer
  • Supplies/material used in iron​
    11·1 answer
  • WILL GIVE BRAINLIEST! The command simplify is used if you only want the first two digits of a decimal to appear in the interpret
    13·1 answer
  • Any movie/show suggestions??
    7·2 answers
  • write a function that given an integer n returns the smallest integer greater than n the sume of whose digits is twice as big th
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!