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
laiz [17]
3 years ago
11

in Java programming Design a program that will ask the user to enter the number of regular working hours, the regular hourly pay

rate, the overtime working hours, and the overtime hourly pay rate. The program will then calculate and display the regular gross pay, the overtime gross pay, and the total gross pay.
Computers and Technology
1 answer:
iren2701 [21]3 years ago
8 0

Answer:

In Java:

import java.util.Scanner;

public class Main {

public static void main(String[] args) {

 int regularhour,overtimehour;

 float regularpay,overtimepay;

 Scanner input = new Scanner(System.in);

 

 System.out.print("Regular Hour: ");

 regularhour = input.nextInt();

 

 System.out.print("Overtime Hour: ");

 overtimehour = input.nextInt();

 

 System.out.print("Regular Pay: ");

 regularpay = input.nextFloat();

 

 System.out.print("Overtime Pay: ");

 overtimepay = input.nextFloat();

 

 float regulargross = regularhour * regularpay;

 float overtimegross = overtimehour * overtimepay;

 float totalgross = regulargross + overtimegross;

 

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

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

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

 

}

}

Explanation:

This line declares regularhour and overtimehour as integer

 int regularhour,overtimehour;

This line declares regularpay and overtimepay as float

 float regularpay,overtimepay;

 Scanner input = new Scanner(System.in);

 

This prompts the user for regular hour

 System.out.print("Regular Hour: ");

This gets the regular hour

 regularhour = input.nextInt();

 

This prompts the user for overtime hour

 System.out.print("Overtime Hour: ");

This gets the overtime hour

 overtimehour = input.nextInt();

 

This prompts the user for regular pay

 System.out.print("Regular Pay: ");

This gets the regular pay

 regularpay = input.nextFloat();

 

This prompts the user for overtime pay

 System.out.print("Overtime Pay: ");

This gets the overtime pay

 overtimepay = input.nextFloat();

 

This calculates the regular gross pay

 float regulargross = regularhour * regularpay;

This calculates the overtime gross pay

 float overtimegross = overtimehour * overtimepay;

This calculates the total gross pay

 float totalgross = regulargross + overtimegross;

 

This prints the regular gross pay

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

This prints the overtime gross pay

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

This prints the total gross pay

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

You might be interested in
How many possible values will an eight bit audio sample have
juin [17]
I think an eight but audio sample has 256 possible values.
6 0
3 years ago
WhyTheCombOfNatashaOtomoskiHas21Teeth?.txt
mash [69]

What is the question?

6 0
3 years ago
Atomic Term If an atom carries no charge, the positive charges from protons are balanced by the negative charges from the
Neko [114]

Answer:

yee ha

Explanation:

7 0
4 years ago
_________ is the amount of data a storage device can move per second from the storage medium to ram.
mote1985 [20]
<span>data transfer rate..</span>
5 0
4 years ago
What is required for sitting with your seatbelt on while driving?
Alexxandr [17]
It should be D I believe
5 0
3 years ago
Other questions:
  • A foreign country attempting to access government networks in order to disable a national power grid would be an example of: Sel
    7·2 answers
  • Why are video games interesting?
    5·1 answer
  • 13) What are the benefits and detriments of each of the following? Consider both the systems and the programmers’ levels. a. Sym
    14·1 answer
  • PLZ HELP ME!!!
    13·1 answer
  • What is a close-up shot, and when it is an appropriate shot choice in a film?
    6·1 answer
  • Use pseudocode to specify a recursive algorithm to compute the nth value of the harmonic series, for some integer n.
    5·1 answer
  • Secure Multipurpose Internet Mail Extensions builds on the encoding format of the MIME protocol and uses digital signatures base
    15·1 answer
  • How do design elements and color work together on a web page?
    15·1 answer
  • Jim wants to shoot a video. This requires him to move from one place to another. Which type of camera support should Jim use?
    13·1 answer
  • Suppose we want to design a combinational logic block that accepts a 4 bit Binary number as input. Let the most significant bit(
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!