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]
2 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]2 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
In Python, while loops will repeat during the time the test condition is true.
frez [133]

Answer:

It is true

Explanation:

3 0
2 years ago
Read 2 more answers
If userA wants to send a secure message to userB using an asymmetric cryptographic algorithm, which key does userB use to decryp
ANTONII [103]

Answer:

userB will use his/her private key.

Explanation:

The steps involved in using asymmetric cryptographic algorithm are as follow:

1. Each user generates a pair of keys to be used for the encryption and decryption of messages.

2. Each user places one of the two keys in a public register or other accessible file. This is the public key. The companion key is kept private.

3. If UserA wishes to send a confidential message to UserB, UserA encrypts the message using UserB's public key.

4. When UserB receives the message, she decrypts it using her private key.

4 0
3 years ago
Write a program that prompts the user for two numbers then outputs the result of dividing the first number by the second number
Rainbow [258]

The program is

num = int(input("Enter Numerator "))

den = int(input("Enter Denominator "))

print("quotient is ",str(num//den)," remainder is ", str(num%den))

<h3>How to create a division sign in HTML?</h3>

To create a division sign ( ÷ ) in HTML you can use any of the following codes.

&divide;

&div;

&#247;

<h3>How to divide in computer programming?</h3>

Perl code

use strict;

my $first = 15;

my $second = 5;

my $answer = $first / $second;

print "You get $answer if you divide $first by $second";

When the script above is run, it displays "You get 3 if you divide 15 by 5" on the screen.

To learn more about programming, refer

https://brainly.ph/question/4743

#SPJ4

5 0
1 year ago
What Network does zoom run on? Does anyone use it (hint Hint)
rewona [7]

Answer:

  • The bandwidth used by Zoom will be optimized for the best experience based on the participant's' network. It will automatically adjust for 3G, WiFi, or wired environments.
  • i use g00gle meet bc zoom does not work on my school macbook...

Explanation:

:)

3 0
2 years ago
Hi please help ASAP it's about html!​
uranmaximum [27]
<h2><u>Given</u> :-</h2>

Create a HTML code for writing a web page for your school time-table.

<h2><u>Answer</u> :-</h2>

<html>

<head>

<title> Time Table </title>

</head>

<hrcolor = "red">

<hrcolor = "blue">

<body>

<table><tr = "7"><md = "7"><Period 1_></table>

</body>

</html>

\\

Answered by - ItzMaster

7 0
2 years ago
Other questions:
  • This is the main work area of your computer.
    7·1 answer
  • Victoria enjoys laughing with her friends as they walk around the track after school. Which best describes her hate rate during
    5·1 answer
  • What type of change can AutoCorrect option make to a word?
    10·2 answers
  • George and Miguel want to know more about their local and online competitors and about the retail industry. What is the best way
    9·1 answer
  • zeroIt is a function that takes one argument and returns no value. The function stores the value 0 back into the parameter. x is
    8·1 answer
  • Lisa is modifying a spreadsheet. Which view will allow Lisa to see how her changes will look when she prints the spreadsheet?
    13·2 answers
  • Chunking is a good strategy for completing large assignments because it makes the work
    7·2 answers
  • Two types of formulas in Excel, what are they? A. Complex and simple, B. General and currency, C. Logical and Boolean, D. Trig a
    15·1 answer
  • Assessment
    12·1 answer
  • How do cyber criminals target user’s end devices?
    11·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!