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
eduard
2 years ago
5

Write a java application that will determine the salary for each of several employees. The

Computers and Technology
1 answer:
nalin [4]2 years ago
4 0

The program illustrates the use of repetitive operations.

The program in java is as follows, where comments are used to explain each line

import java.util.*;

public class Main{

   public static void main(String [] args){

<em>//This creates a scanner object</em>

       Scanner input = new Scanner(System.in);

<em>//This declares employee number and hours, as integer</em>

       int empNum, hrs;

<em>//This declares the rate and pay (salary) as double</em>

       double rate,pay;

<em>//This gets input for employee number</em>

       empNum = input.nextInt();

<em>//The following while operation is repeated until user inputs -1</em>

       while(empNum != - 1){

<em>//This gets input for worked hours</em>

           hrs = input.nextInt();

<em>//This gets input for work rate</em>

           rate = input.nextDouble();

<em>//This calculates the pay (base salary)</em>

           pay = rate * hrs;

<em>//If worked hours is more than 40</em>

           if(hrs >40){

<em>//This calculates the additional pay</em>

               pay += 0.5 * pay;

           }

<em>//This prints the total salary</em>

           System.out.println("Salary: "+pay);

<em>//This gets input for the employee number            </em>

           empNum = input.nextInt();

       }

   }

}<em>// The program ends here</em>

At the end of the program, the program prints the employee's salary

See attachment for sample run

Read more about java programs at:

brainly.com/question/15831954

You might be interested in
What was the strategy the company adopted for ERP implementation?
SashulF [63]

Answer:

Big Bang or Phased Approach – ERP Implementation strategies include Big Bang, Phased, Hybrid, and Parallel Adoption. Each organization requirements are different and as such, the project management method is itself evolving using PPM, SCRUM, and DevOps.

8 0
2 years ago
Which statement is true about dynamic microphones?
Xelga [282]

Answer:

b they have high sensitivity to surrounding sound

Explanation:

tell me it's correct or not

if it's correct so I hope it is helpful for you

but no so I am sorry

6 0
2 years ago
Read 2 more answers
You have just built a new system from scratch. you turn the computer on but the system boot fails and sounds a beep code. what m
IgorLugansk [536]
The issue would be that the memory was not installed or was not detected by the system. If this happens, the system boot will fail and a beep code is heard. The system would not show anything since all of the software are in the memory which was not installed or detected.
4 0
3 years ago
Can i have two e-mail accounts on my android
Scrat [10]
Yes, if you download an app such as gmail or yahoo mail. hope this answered your question.
5 0
3 years ago
In word, the ____ presents the most accurate view of how your document will look when printed, displaying the entire page on scr
makkiz [27]
<span>When using Microsoft Word, the "Print Preview" presents the most accurate view of how the document will look when it is printed. When using "Print Preview" the entire page is displayed on screen, making it easier to see what adjustments should be made to the page layout, such as spacing or text size.</span>
7 0
3 years ago
Other questions:
  • What new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its impo
    7·1 answer
  • Which statement is true about parity in RAM?
    11·1 answer
  • When you set the position property for a block element to fixed, the element
    5·1 answer
  • ) Which is true about the agile method?
    7·1 answer
  • Which is a benefit of getting information from a government website?
    15·2 answers
  • Pls help me im confused prob more on the way
    6·1 answer
  • A university with remote campuses, which all use different service providers, loses Internet connectivity across all locations.
    12·1 answer
  • What year did polaroid introduce one-step photography with the SX-70
    14·1 answer
  • 10.
    12·1 answer
  • A(n) ______is like an intranet except it shares its resources with users from a distant location. Select your answer, then click
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!