answer.
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]
2 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]2 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
Zoom Vacuum, a family-owned manufacturer of high-end vacuums, has grown exponentially over the last few years. However, the comp
Sati [7]

Answer:

The best advice for Zoom Vacuum is  to start with a Transaction Processing System(TPS). This system will process all the day to day transactions of the system. It is like a real time system where users engage with the TPS and generate, retrieve and update the data. it would be very helpful in lowering the cost of production and at the same time manufacture and produce standard quality products.

Although, TPS alone would not be sufficient enough. so Management Information System(MIS) would be needed, that can get the data from the TPS and process it to get vital information.

This MIS will bring about information regarding the sales and inventory data about the current and well as previous years.

With the combination of TPS as well as MIS is a minimum requirement for a Zoom Vacuum to become successful in the market.

Explanation:

Solution

When we look at the description of the Zoom Vacuum manufacturing company closely, we see that the business is currently a small scale business which is trying to become a small to mid scale business. This claim is supported by the fact that there is only one manufacturing plant and three warehouses. And here, we also need to have the knowledge of the fact that small business major aim is to keep the cost low and satisfy the customers by making good products. So we need to suggest what information system is best suited for small scale business enterprises.

The best recommendation would be to start with a Transaction Processing System(TPS). This system will process all the day to day transactions of the system. It is like a real time system where users interact with the TPS and generate, retrieve and modify the data. This TPS would be very helpful in lowering the cost of production and at the same time manufacture and produce standard quality products . Also TPS can help in communicating with other vendors.

But TPS along would not be sufficient. Also Management Information System(MIS) would be required that can get the data from the TPS and process it to get vital information. This MIS will help in generating information regarding the sales and inventory data about the current and well as previous years. Also MIS can create many types of graphical reports which help in tactical planning of the enterprise.

So a combination of TPS as well as MIS is a minimum requirement for a Zoom Vacuum to become successful in the market.

7 0
2 years ago
Most ________ are accompanied by several common utility programs, including a search program, a storage management program, and
diamong [38]

Answer:

operating systems

Explanation:

The operating systems is shortly known as OS. It is a system software which manages the software resources of the computer, computer hardware and also provides some common services for the various computer programs.

Most of the operating systems available in the market provides some common utility programs such as the search program, a backup program and a storage management program also.

Some common operating systems are : Linux, Microsoft Windows, Ubuntu, macOS, Unix, and many more.

4 0
2 years ago
12) Suppose you wanted a subroutine to return to an address that was 3 bytes higher in memory than the return address currently
Snezhnost [94]

Answer:

.code

main proc

mov ecx,ebp

mov ecx, 787878

push ecx

call MySe7en

invoke ExitProcess,0

main endp

MySe7en PROC

pop ecx

sub ecx, 3

mov

push ecx

ret

end main

8 0
2 years ago
PLEASE HELP!!~~
Law Incorporation [45]

Answer:

A

Explanation:

7 0
2 years ago
2) Complete the get_num_of_characters() function, which returns the number of characters in the user's string. We encourage you
Lilit [14]

Explanation:

Number of characters: 46

String with no whitespace: Theonlythingwehavetofearisfearitself.

########################################################

def get_num_of_characters(inputStr):

   count = 0

   for i in range(0,len(inputStr)):

       count = count + 1

   #count = len(inputStr)

   return count

def output_without_whitespace(inputStr):

   #statement = statement.strip()

   statement2 = ' '

   for i in range(0,len(inputStr)):

        if(inputStr[i] == ' '):

           statement2 = statement2

       else:

           statement2 = statement2 + inputStr[i]

       

   inputStr = inputStr.replace(" ", "")

   return statement2

inputStr = input('Enter a sentence or phrase: ')

print()

print('You entered:', inputStr)

num = get_num_of_characters(inputStr)

print()

print('Number of characters:', num)

print('String with no whitespace:',output_without_whitespace(inputStr))

#if __name__ == '__main__':

   # Think I'm supposed to use this if statement

########################################################

'''ERROR MESSAGE WHEN RUNNING TEST

Unit test

0/1

Tests that get_num_of_characters() returns 46 for "The only thing we have to fear is fear itself."

Your output

Enter a sentence or phrase: Traceback (most recent call last):

 File "zyLabsUnitTestRunner.py", line 4, in <module>

   from zyLabsUnitTest import test_passed

 File "/home/runner/local/unit_test_student_code/zyLabsUnitTest.py", line 1, in <module>

   from main import get_num_of_characters

 File "/home/runner/local/unit_test_student_code/main.py", line 19, in <module>

   inputStr = input('Enter a sentence or phrase: ')

EOFError: EOF when reading a line'''

6 0
2 years ago
Other questions:
  • What tool extends the basic functionality provided in task manager with additional features and tools?
    8·1 answer
  • f the copyright date on the homepage is more than 1 year old, the website should always be considered unmaintained
    8·1 answer
  • Gloria needs to show in spreadsheet form the number of students in her class who speak different languages. Which type of graph
    7·1 answer
  • If the__________ is/are out of balance, the driver will feel a pounding or shaking through the steering wheel.
    7·2 answers
  • When performing actions between your computer and one that is infected with a virus, which of the following offers NO risk of yo
    11·2 answers
  • Grabar microphone audio icon_person click each item to hear a list of vocabulary words from the lesson. then, record yourself sa
    7·2 answers
  • Write an if-else statement that prints "Goodbye" if userString is "Quit", else prints "Hello". End with newline.
    11·2 answers
  • Omar wants to add transitions to his presentation, so he clicks the Transitions tab. Which tasks can he now complete? Check all
    10·1 answer
  • Write a MATLAB function named average_of_scores_with_drops The function will have two inputs and two return values. The first in
    11·1 answer
  • What are ways to enter a formula in Excel? Check all that apply. Click on the Function Library group and select a function from
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!