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
Nataly [62]
4 years ago
12

create a Java program that prompt the user to enter a number of hours, wages, over time factor, then your program should calcula

te the employee total wages. Make sure your program can calculate the over time and regular wages if number of hours are great than 40 hours. Use 1.5 for over time factor. Make sure your Java code has comments showing declarations and description of your variables.
Computers and Technology
1 answer:
prohojiy [21]4 years ago
3 0

Answer:

The program to the given question as follows:

Program:

import java.util.*; //import package for user input.

public class Main //defining class Main

{

public static void main(String[] as) //defining main method

{

final double over_time_factor = 1.5; //define final variable

double number_Of_hours,wages,total_Wages=0; //defining variables  

System.out.println("Enter hours and wages rate:"); //print message

Scanner obc = new Scanner(System.in); //creating Scanner class object for user input

number_Of_hours = obc.nextDouble(); //taking input

wages = obc.nextDouble(); //taking input

if(number_Of_hours>40) //check condition if number_Of_hours greter then 40

{

total_Wages=40*wages+(number_Of_hours-40)*wages*over_time_factor; //calculate value

}

else //else part

{

total_Wages = number_Of_hours*wages; //calculate total_Wages

}

System.out.println("Total Wages: $"+total_Wages); //print value

}

}

Output:

Enter hours and wages rate:

12

3

Total Wages: $36.0

Explanation:

In the above java program, the package is first imported into the user input and then the class is defined and inside this, the main method is defined, that defines a double type final variable "over_time_factor" is defined that holds a value "1.5", Then double type variable is defined that are " number_Of_hours, wages, and total_Wages", in which first two variables are used for taking input from the user and the third variable is used to calculate their values. After taken input from the user, the conditional statement is used that can be defined as follows:

  • The if block, checks the variable "number_Of_hours" value is greater than 40 it will calculate over_time_factor value that is held by total_Wages variable.  
  • In else block, it will multiply the user input value that is store in total_Wages variable.  
  • At the end of the conditional statement, the print function is used that prints total_Wages variable value.  

You might be interested in
___ are limited computers because they are placed inside devices which require specific computing functions
Pachacha [2.7K]

I guеss thе cοrrеct answеr is Еmbеddеd systеms  

An еmbеddеd systеm is a prοgrammеd cοntrοlling and οpеrating systеm with a dеdicatеd functiοn within a largеr mеchanical οr еlеctrical systеm, οftеn with rеal-timе cοmputing cοnstraints. It is еmbеddеd as part οf a cοmplеtе dеvicе οftеn including hardwarе and mеchanical parts.

3 0
3 years ago
What is output?
Alex777 [14]

Answer:

The output of this question is 21. As show in the image

The explanation is given in below

Explanation:

Let first write the question

C=1

sum = 0

while(C<10):

C=C+3

sum=sum + C

print(sum)

Now Focus on

while(C<10):

C=C+3

sum=sum + C

The value of C is initially 1

C=1+3

Sum= 0+4

In second loop the value of C will become 4

c=4+3

sum=4+7

In third loop the value of C will be 7

c=7+3

sum=11+10

so the answer is 11+10=21

7 0
3 years ago
Taken together, the physical and data link layers are called the ____________________. Internet layer Hardware layer Internetwor
IrinaK [193]

Answer:

Hardware layer

Explanation:

The hardware layer's job is to maintain and put to action central processor units and memory. Hardware layer first check the availability of the for mentioned duo and then decides the need to put one or another into action. Physical and data link layers act the same in the hardware layer. They bot are waiting to be called in action

6 0
3 years ago
To generate a series of first ten counting number of algorithm​
Anettt [7]
Uhh i need points so i don’t fail math.
3 0
3 years ago
What is one advantage of hard-disk recording?
NemiM [27]

Answer:

It allows for Non-linear editing

7 0
3 years ago
Other questions:
  • Emma wants to create a web page for her school’s volleyball team. Which of these could she use?
    7·1 answer
  • Unix/linux are ____ systems, which let many people simultaneously access and share the resources of a server computer.
    13·1 answer
  • Which one is not among standard creation committee?
    9·1 answer
  • what tool can a student use to make sure his or her work paper does not take credit for someone else's work ?
    5·1 answer
  • Using the Vigenere cipher, does the length of the key matter?
    8·1 answer
  • URGENT!!! Which file format is used mainly in the Microsoft Windows operating system?
    15·2 answers
  • What is the primary means by which attackers infect computers with these attacks? How do these attacks commonly occur?
    8·1 answer
  • Please help i will give you brainiest and 5 stars answer the question!!!!!!!!!!!!!!!!!!!!!!!!!
    7·1 answer
  • What critical-thinking tool is being used when asking the question, "Is there a large enough scope of
    10·1 answer
  • Is each of the following method identifiers (a) legal and conventional, (b) legal but unconventional, or (C) illegal?
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!