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
grigory [225]
4 years ago
15

Write an application that calculates and displays the weekly salary for an employee. The main() method prompts the user for an h

ourly pay rate, regular hours, and overtime hours. Create a separate method to calculate overtime pay, which is regular hours times the pay rate plus overtime hours times 1.5 times the pay rate; return the result to the main() method to be displayed. Save the program as Salary.java.
Computers and Technology
1 answer:
Serjik [45]4 years ago
5 0

Answer:

// import package

import java.util.*;

// class definition

class Salary

{

   // method to calculate weekly salary

   public static double fun(int p_rate,int r_hour,int o_hour)

   {

       // calculate weekly salary

       double w_salary=(p_rate*r_hour)+(o_hour*p_rate*1.5);

       // return salary

       return w_salary;

   }

   // main method of the class

public static void main (String[] args) throws java.lang.Exception

{

   try{

    // object to read value from user

    Scanner scr=new Scanner(System.in);

   

       System.out.print("enter hourly pay rate: ");

       // read hourly pay rate

       int p_rate=scr.nextInt();

     

       System.out.print("enter regular hours: ");

       //read regular hours

       int r_hour=scr.nextInt();

       

       System.out.print("enter overtime hours : ");

       // read overtime hours

       int o_hour=scr.nextInt();

       // call the method

       System.out.println("weekly salary of an employee :"+fun(p_rate,r_hour,o_hour));

   }catch(Exception ex){

       return;}

}

}

Explanation:

Read hourly pay rate, regular hours and overtime hours from user.Call the method sal() with these parameters.There weekly salary is calculated by multiply regular hours with p_rate and overtime hours with 1.5 time of p_rate.Sum both of them, this will be the weekly salary.return this to main method and print it.

Output:

enter hourly pay rate: 50                                                                                                  

enter regular hours: 35                                                                                                    

enter overtime hours : 15                                                                                                  

weekly salary of an employee :2875.0

You might be interested in
18. What do we call the Microsoft Word File?
Colt1911 [192]

Answer:

<h2>we call Microsoft Word File "<u>document</u>" or "<u>docx</u>"</h2>
5 0
2 years ago
When using Microsoft word, what would happen to the text of a paragraph if the "Justify" option is used?
Bond [772]
Hello, and thank you for asking your question!

When you click on the 'Justify' option on any type of word pad, it'll make all lines of words perfectly aligned. Here is a quick few-sentence example I made. 
(Photo)

Hope this helps! ☺♥

3 0
3 years ago
Which name is a default library name in Windows 7?
Blizzard [7]

Answer:

In Windows 7, there are four default libraries: Documents, Music, Pictures, and Videos. All the default libraries include two standard folders: the user folder specific to each library and the public folder specific to it.

Explanation:

6 0
3 years ago
Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, ma
juin [17]

Answer:True

Explanation:

Many organizations find themselves in the position of being data rich and information poor. Even in today's electronic world, managers struggle with the challenge of turning their business data into business intelligence.Data in its raw form does not help managers in reaching their business decisions. In this electronic age data collection has been made simple .However the value of that data can only be seen when it is processed and it becomes information. It can help managers to make quick business decisions that will be used to make come up with important business strategies  .It follows that when data is collected in its various forms it should then be processed meaning that the business managers can either use business Intelligent software  that can present the data in a meaningful form like graphs . pie charts and other forms that can be easily interpreted and reflect the trends that have been presented by the raw data .The organisation should find value in the data that they have collected and tell the story that leaves in the data.

7 0
3 years ago
We want to implement a data link control protocol on a channel that has limited bandwidth and high error rate. On the other hand
Korolek [52]

Answer:

Selective Repeat protocols

Explanation:

It is better to make use of the selective repeat protocol here. From what we have here, there is a high error rate on this channel.

If we had implemented Go back N protocol, the whole N packets would be retransmitted. Much bandwidth would be needed here.

But we are told that bandwidth is limited. So if packet get lost when we implement selective protocol, we would only need less bandwidth since we would retransmit only this packet.

6 0
3 years ago
Other questions:
  • When does a kernel panic occur?
    12·2 answers
  • A 5.5 g sample of a substance contains only carbon and oxygen. Carbon makes up 35% of the mass of the substance. The rest is mad
    8·1 answer
  • A computer with a frequency 2 GHZ and its average cycle per instruction is 2. what is the MIPS of the computer?
    6·1 answer
  • What is one expectation of open-source software?
    15·1 answer
  • Write a program that reads a stream of integers from the console and stores them in an array. The array is then analyzed to comp
    10·1 answer
  • Which of the following statements is NOT true regarding the Security Configuration and Analysis (SCA) tool?
    12·1 answer
  • Why each of the six problem-solving steps is important in developing the best solution for a problem
    11·1 answer
  • You created a database related to computer hardware parts and their details. You'd like to view the names of the parts in alphab
    9·1 answer
  • I really need help with this question
    14·1 answer
  • The tags are always enclosed within a pair of<br>(a) curly<br>(b) square<br>(©) angular​
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!