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
1) Which of the following would you NOT see on a Windows 10 Start menu?
Sati [7]
Task view

I hope this helps you :)
3 0
2 years ago
What are web protocols.
RoseWind [281]

Answer:

Web protocols are a set of standards used to exchange information. It ensures that code can be modular and portable.

7 0
2 years ago
Read 2 more answers
In Mandatory Access Control sensitivity labels attached to object contain what information?
larisa86 [58]

Answer:b)The item’s classification and category set

Explanation: Mandatory access control(MAC) is the security component in the computer system. It is regarding the controlling the access of the operating system by the administrator.The accessing is made limited by the MAC according to the sensitivity of the data .

The authorization for user to access the system is based on this sensitivity level known sensitivity label. The objects contain the information regarding the classification and categories or level of items. Thus, the correct option is option(b).

7 0
3 years ago
Suppose the CashRegister needs to support a method void undo() that undoes the addition of the preceding item. This enables a ca
a_sh-v [17]

Answer:

previousAddition instance variable

Explanation:

In order to accomplish this you would need to add a previousAddition instance variable. In this variable you would need to save the amount that was added at the end of the process. Therefore, if a mistake were to occur you can simply call the previousAddition variable which would have that amount and subtract it from the total. This would quickly reverse the mistake, and can be easily called from the undo() method.

3 0
3 years ago
Suppose you want to find a specific piece of hardware at the lowest price, and you don't mind if it's used. Which type of purcha
tino4ka555 [31]

Answer:

consumer-to-consumer auction site

Explanation:

The best type of purchase for this scenario would be a consumer-to-consumer auction site. These sites allow anyone to make a publication selling their product. This publication can be seen by anyone around the world. It is the best way of finding the cheapest prices for a specific item. The condition of the items on these sites can vary. The majority of the time they are used items in good conditions, but can also be new items or very worn out items being sold for parts.

7 0
3 years ago
Other questions:
  • To create a digital file from an old photo, I would use a _____.
    10·1 answer
  • What type of document would you use the landscape page orientation
    7·1 answer
  • Building relationships during your career exploration is called
    6·1 answer
  • Write a program that reads three numbers and print the largest one step by step answer
    9·1 answer
  • Assume that a variable variable, number Of Sides has been initialized. Write a statement that assigns the value True to the vari
    8·1 answer
  • How are IP addresses usually written?
    7·1 answer
  • Rafi is developing an application to send urgent information about global health crises over the Internet to hospitals. He is wo
    6·1 answer
  • Your friends are having difficulties with their computer setups. Can you suggest a way to help each friend?
    5·1 answer
  • Which of the following best explains how the Internet is a fault-tolerant system?
    7·2 answers
  • Think of some local businesses that have websites. Look online and identify two different websites for businesses or services in
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!