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
Tom [10]
3 years ago
7

Weekly salary and assumes work-hours-per-week limit of 40. Overtime refers to hours worked per week in excess of some weekly lim

it, such as 40 hours. Some companies pay time-and-a-half for overtime hours, meaning overtime hours are paid at 1.5 times the hourly wage. Write a code that calculate Overtime pay (assuming a weekly limit of 40 hours).

Computers and Technology
1 answer:
hodyreva [135]3 years ago
8 0

Answer:

import java.util.Scanner;

public class WeeklySalary {

   public static void main(String[] args) {

       Scanner in = new Scanner(System.in);

       System.out.println("Enter Hourly wage");

       double hourlyWage = in.nextDouble();

       System.out.println("Enter total hours worked in the week");

       int hoursWorked = in.nextInt();

       int overtime = hoursWorked - 40;

       double weeklyWage = 40*hourlyWage;

       System.out.println("Total Over Time Hours is: "+overtime);

       double overTimeWage = overtime*(hourlyWage*1.5);

       System.out.println("Wage for full time: "+ weeklyWage);

       System.out.println("Wage for over time: "+ overTimeWage);

   }

}

Explanation:

  • Using Java programming language
  • Import the Scanner class to receive user input
  • prompt user for hourly wage rate, receive and save in a variable
  • Prompt user for total hours worked for the week receive and save in a variable
  • calculate overtime hours by subtracting 4 from total hours worked in the week
  • Calculate weekly wage by multiplying hourly rate by 40
  • Calculate overtime by multiplying overtime hours by (hourlyWage*1.5).
  • See attached sample run of the code

You might be interested in
Assignment 4: Evens and Odds
Anika [276]

n = int(input("How many numbers do you need to check? "))

odd = 0

even = 0

i = 0

while i < n:

   num = int(input("Enter number: "))

   if num % 2 == 0:

       even += 1

       print(str(num)+" is an even number")

   else:

       odd += 1

       print(str(num)+" is an odd number")

   i += 1

print("You entered "+str(even)+" even number(s).")

print("You entered "+str(odd)+" odd number(s).")

I hope this helps!

5 0
3 years ago
A ---------------- enable an organization to use cloud computing technology as a means of centralizing access to IT resources by
sp2606 [1]

Answer: Private cloud

Explanation:

In a private cloud it is owned by the organization and its cloud computing technology is utilized by its various departments as a centralized access to its IT resources. Here the authority of the cloud lies entirely to the organization.

7 0
3 years ago
Choose the correct comparison statement about delivery and read receipts.
Lostsunrise [7]

Answer:

A: Delivery receipts can be enabled for all messages, while read receipts can be turned off by the recipient.

5 0
3 years ago
What is computer hardware / software​
Pavel [41]

Answer: <u>Computer hardware is any physical device used in or with your machine, like for example, a mouse, or a keyboard.</u> Computer software is a collection of programming code installed on your computer's hard drive it can process billions of data and inputs through this.

Hope this helps!

5 0
3 years ago
(Find the number of uppercase letters in a string) Write a recursive function to return the number of uppercase letters in a str
Leokris [45]
Def countUppercase(s):
count=0
for i in s:
if i.isupper():
count+=1
s=s.replace(i, "")
else:
s=s.replace(i, "")
countUppercase(s)
return count

element=input("Enter the string: ")
string=countUppercase(element)
print("\nNumber of upper letter in the string: ",string)

3 0
3 years ago
Other questions:
  • Look at the following array definition:
    11·1 answer
  • Progressively enhancing a web page for different viewing contexts (such as smartphones and tablets) through the use of coding te
    11·1 answer
  • Gary lives in an area that receives high rainfall throughout the year. Which device would be useful to him to maintain his compu
    10·2 answers
  • What are the major features of a successful ethics training program and communication systems? Think of an example of a company
    13·1 answer
  • Java languageThe cost to ship a package is a flat fee of 75 cents plus 25 cents per pound.1. Declare a constant named CENTS_PER_
    5·2 answers
  • What is one important feature of an AUP?
    14·1 answer
  • Discuss the term business information SYSTEMS ​
    15·1 answer
  • Which two components are configured via software in order for a PC to participate in a network environment
    5·1 answer
  • Which of the following is an example of a directory path? Check all of the boxes that apply.
    15·2 answers
  • Write a Boolean expression that tests if the value stored in the variable num1 is equal to the value stored in the variable num2
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!