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
What are the inputs that the model uses to make decisions?
hodyreva [135]

Answer:

It makes the decision better and adds ownership in the implementation

Explanation:

Hope this helps C:

~Chiena

8 0
2 years ago
What's exactly the difference between "Library" and "Framework" ? ​
Mariana [72]
Answer:

The key difference between a library and a framework is “Inversion of Control”. When you call a method from a library, you are in control. But with a framework, the control is inverted:the framework calls you

Explanation:

A library performs specific, well-defined operations.

A framework is a skeleton where the application defines the "meat" of the operation by filling out the skeleton. The skeleton still has code to link up the parts but the most important work is done by the application.

Examples of libraries: Network protocols, compression, image manipulation, string utilities, regular expression evaluation, math. Operations are self-contained.

Examples of frameworks: Web application system, Plug-in manager, GUI system. The framework defines the concept but the application defines the fundamental functionality that end-users care about.
8 0
3 years ago
What keeps unauthorized internet users out of private intranets?
Kruka [31]
I think coders put in codes. Sry if that does not help.
8 0
3 years ago
Select the correct answer.
tia_tia [17]

Answer:

A

Explanation:

HTML is a coding language.

8 0
3 years ago
Products in which titanium is used
Lynna [10]

Answer:

It is used in jewelry, tennis rackets, scissors, bicycle frames, surgical tools, mobile phones and some other high-performance products.

Explanation:

Titanium is a familiar metal. Titanium is as strong as steel but weights about half as much.

6 0
3 years ago
Read 2 more answers
Other questions:
  • How can development in ICT be utilized to speed up the development and integration efforts
    15·1 answer
  • What type of survey can help a network administrator make decisions about bands, channels, and widths when installing new access
    9·1 answer
  • Why is the stateless nature of the internet a problem for shopping cart software? g?
    5·2 answers
  • Why should you not perform any personal grooming task while driving?
    5·2 answers
  • What tool can help discover and report computer errors and conflicts that occur when you first turn on a computer and before the
    15·1 answer
  • File-sharing programs such as Napster, Kazaa, and iMesh make it possible for individuals to exchange music files over the Intern
    7·1 answer
  • Design and implement an application that plays the Hi-Lo guessing game with numbers. The program should pick a random number bet
    13·1 answer
  • What can a user modify on a business card using the Edit Business Card dialog box? Check all that apply.
    6·1 answer
  • MULTIPLE CHOICE QUESTION
    14·2 answers
  • Which of the following is not a common input device?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!