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
When creating an HTML document, what do we use to set aside space for content?
Minchanka [31]

Tags are use to set aside space for contents

<h3 /><h3>What is HTML?</h3>

HTML simply means hypertext mark-up language . This is a language for document that are design to be displayed in the web browser.

Tags are HTML codes that defines how a web browser will format and display the content.

The tags is used to set aside space to accommodate contents. Example of tags are header tags(<h1>, <h2>, <h3>, <h4>, <h5> and <h6>), paragraph tag(<p>).

learn more on HTML here: brainly.com/question/9069928

5 0
2 years ago
For what kind of shot is a fisheye lens most appropriate?
OlgaM077 [116]

Answer: B

Explanation: a fisheye lense is good for wide shots.

7 0
3 years ago
Write a program that will remove "May" from the list using .Pop and .Index methods.(5pts) GIVEN: lst=["January", "February", "Ma
Inga [223]

Answer:

This question is answered in Python

lst=["January", "February", "March", "April", "May", "June"]

index = lst.index('May')

lst.pop(index)

print(lst)

Explanation:

This initializes the list

lst=["January", "February", "March", "April", "May", "June"]

This gets the index of May

index = lst.index('May')

This removes "May" from the list using pop()

lst.pop(index)

This prints the updated list

print(lst)

5 0
3 years ago
Andy is trying to put together a holiday gift knapsack (with W=8) for Sarah. He has n items to choose from, each with infinitely
Sever21 [200]

Answer:

See explaination

Explanation:

Given 3 items: {w1 = 1, v1 = 3}, {w2 = 3, v2 = 2}, {w3 = 4, v3 = 3}

Hence OPT(1) = 3, OPT(3) = 2, OPT(4) = 3

Recursive formula for OPT(k) to minimize value is

OPT(k) = INFINITE if k <= 0

= min(3 + OPT(k-1), 2 + OPT(k-3), 3 + OPT(k-4))

Let us calculate OPT(1) to OPT(8)

OPT(1) = 3

OPT(2) = min ( 3 + OPT(1), 2 + OPT(-1), 3 + OPT(-2)) = 6

OPT(3) = 2

OPT(4) = 3

OPT(5) = min ( 3 + OPT(4), 2 + OPT(2), 3 + OPT(1)) = min(6, 8, 6) = 6

OPT(6) = min ( 3 + OPT(5), 2 + OPT(3), 3 + OPT(2)) = min(9, 4, 9) = 4

OPT(7) = min ( 3 + OPT(6), 2 + OPT(4), 3 + OPT(3)) = min(7, 5, 5) = 5

OPT(8) = min ( 3 + OPT(7), 2 + OPT(5), 3 + OPT(4)) = min(8, 8, 6) = 6

3 0
3 years ago
True or false
atroni [7]

Answer:

for no.2 true and for Ctrl-Z False

Explanation:

Ctrl-z is and "undo" shortcut

not really sure about no.1 though, sorry :(

5 0
3 years ago
Other questions:
  • Write a recursive method public static String reverse(String str) that computes the reverse of a string. For example, reverse("f
    6·1 answer
  • Change control in application development is a formal process for changing written documentation into online documentation, and
    13·1 answer
  • That is Entrepreneur ? ?<br>​
    8·1 answer
  • What are you guys doing?
    13·2 answers
  • 1- Which of the following is the java keyword used to declare a class?
    5·2 answers
  • When power is completely removed from your computer
    11·1 answer
  • Convertbinary(111100)to decimal​​​​
    13·2 answers
  • Please help me plss! PLS​
    8·2 answers
  • If there are over 1,000 websites about a certain topic, the information is reliable. A. True B. False
    12·1 answer
  • terms found in provider documentation (e.g., difficult, extensive, or unusual) would support adding modifier to a cpt code.
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!