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
LIST THE SKILLSET NEEDED FOR BECOMING A PROGRAMMER.
wolverine [178]

Answer:

Proficiency with programming languages.  

Learning concepts and applying them to other problems.  

Mathematical skills.  

Problem-solving capability.  

Communication skills.

Writing skills.  

Inquisitiveness.  

Self-motivation.

7 0
3 years ago
What is not one of the main stages of the hardware lifecycle?
galina1969 [7]

Recycling is not one of the main stages of the hardware lifecycle.

<h3>What is hardware life cycle main stages?</h3>

They are:

  • Procurement
  • Deployment
  • Maintenance
  • Retirement.

Hence, Recycling is not one of the main stages of the hardware lifecycle.

Learn more about hardware lifecycle from

brainly.com/question/17076377

#SPJ1

5 0
2 years ago
Time 20,36,48 <br> answer please!!
anyanavicka [17]

Answer:

Pls subscribe my channel on yt

Name- CREATIVITY WITH MS

pls help me reach 500 subscribers

your subscription really matters

After subscribing pls make sure to comment also

I will give you 10 thanks and also if you have a channel I can subscribe it also

3 0
3 years ago
If two light bulbs are wired in series and one bulb burns out the other bulb will
Natali5045456 [20]
The other bulb would not work

5 0
3 years ago
Read 2 more answers
Write a function square_evens(values) that takes a list of integers called values, and that modifies the list so that all of its
Assoli18 [71]

Answer:

#create the function

def square_evens(values):

   count_Value = 0

   #loop loop for iteration

   for i in values:

       #check for even number

       if (i) % 2 == 0:

           values[count_Value] = i * i  #store the square in the same index

       count_Value =count_Value + 1

   print(values)  #print the list

# list of integers

values = [1, 2, 3, 4, 5, 6]

#calling the function

square_evens(values)

Explanation:

The above code is written in python. first, create the function square_evens() which takes one parameter of the list.

inside the function declare the variable and then take a for loop for traversing each element in the list. Inside the for loop, we take the if-else statement for checking the number is even. if the number is even then stored the square of that value in the same list. To store the square value in the same index, we take the count variable for tracking the index.

After the all element in the list checked, the program terminates the loop and then print the updated list on the screen.

Outside the function, create the list with an integer value and then calling the function with passing the list argument.  

NOTE: In the python programming, please keep the indentation in code.

4 0
3 years ago
Other questions:
  • Edmund wants to visit his university's website. Which software application would he use?
    14·1 answer
  • Create and integrate a script on the registration.html page that stores the input field data into hidden fields to be used in th
    5·1 answer
  • You can use this effect to break a color into a percentage of its full strength.
    13·1 answer
  • Eric has asked you to help him build a new gaming computer so that he can play the newest games available. He also wants the com
    6·1 answer
  • Can anyone help with this graded assignment for computer fundamentals
    10·1 answer
  • Which one of the following terms is defined as the material and surfaces upon which an artist works?1. Applied arts2. Context3.
    5·1 answer
  • Most of the revenue that magazine companies generate comes from?
    8·2 answers
  • Which of the following statements best represents the impact vaudeville had on the film industry? Early silent films were more r
    14·1 answer
  • The fractional_part function divides the numerator by the denominator, and returns just the fractional part.
    10·1 answer
  • An object completes one round of circle of radius 7m in 20 sec. Distance travelled after 10 sec is? ​
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!