Right click on the BlueJ workspace and select New Class. This will require you to enter a name. Enter the word Activity1PayStub as the name. -Make sure you adhere to the Checkstyle conventions with your code. Now copy and paste the following code into the editor.  import java.util.Scanner; /** * Activity1PayStub class is part of Lab 3 and * creates a simple pay stub. * * @author (your name) * @version (date) */ public class Activity1PayStub { public static final double OVERTIME_RATE = 1.5; /** * It all starts with the main method. * * @param args command-line arguments (not used) */ public static void main(String[] args) { } } (a) Declare a Java Scanner object (notice the import statement in the code above) to get user input values for the following data. Do not use the class given last week. It's time to use the real Scanner class! You will need a variable for the (single!) Scanner object, as well as variables for each of the data items below: ˆ Employee name ˆ Employee social security number (with hyphens) ˆ Regular (not overtime) hours worked (an integer) ˆ Overtime hours worked (an integer) ˆ Hourly pay rate (a decimal value) Read a value into each of the variables you created above using the Scanner object you declared. Make sure to prompt the user for each input. (Read the entire social security number, including hyphens, as one input.) Use print (not println) in your prompts, and do not include any newline characters in your arguments to print. The user must enter their response to each of your prompts on the same line as the prompt or your code will not pass the tests. See the sample run on the very last page of this document to see what the user's interactions with your code should look like. (b) Calculate the following values: ˆ Regular pay ˆ Overtime pay  the overtime rate is 1.5, i.e., the overtime pay rate is 1.5 times the (regular) hourly pay rate ˆ Gross pay (total pay before taxes) ˆ Social security withholding (10% of gross pay) ˆ Federal tax (20% of gross after social security is deducted) ˆ Net pay (total after all deductions) Any tax rates or factors should be declared as constants. Constants go before the main method but inside the class. The position of OVERTIME_RATE in the code above shows the correct placement for constants. (c) After you have collected appropriate input from the user, use formatted output statements to display a pay stub that looks exactly like the following. How to achieve this is discussed below:

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Right click on the BlueJ workspace and select New Class. This will require you to enter a name. Enter
the word Activity1PayStub as the name. -Make sure you adhere to the Checkstyle conventions with your code.

Now copy and paste the following code into the editor. 
import java.util.Scanner;
/**
* Activity1PayStub class is part of Lab 3 and
* creates a simple pay stub.
*
* @author (your name)
* @version (date)
*/
public class Activity1PayStub
{
public static final double OVERTIME_RATE = 1.5;
/**
* It all starts with the main method.
*
* @param args command-line arguments (not used)
*/
public static void main(String[] args)
{
}
}

(a) Declare a Java Scanner object (notice the import statement in the code above) to get user input
values for the following data. Do not use the class given last week. It's time to use the real
Scanner class! You will need a variable for the (single!) Scanner object, as well as variables for
each of the data items below:
ˆ Employee name
ˆ Employee social security number (with hyphens)
ˆ Regular (not overtime) hours worked (an integer)
ˆ Overtime hours worked (an integer)
ˆ Hourly pay rate (a decimal value)
Read a value into each of the variables you created above using the Scanner object you declared.
Make sure to prompt the user for each input. (Read the entire social security number, including
hyphens, as one input.) Use print (not println) in your prompts, and do not include any newline
characters in your arguments to print. The user must enter their response to each of your prompts
on the same line as the prompt or your code will not pass the tests. See the sample run on the
very last page of this document to see what the user's interactions with your code should look
like.
(b) Calculate the following values:
ˆ Regular pay
ˆ Overtime pay  the overtime rate is 1.5, i.e., the overtime pay rate is 1.5 times the (regular)
hourly pay rate
ˆ Gross pay (total pay before taxes)
ˆ Social security withholding (10% of gross pay)
ˆ Federal tax (20% of gross after social security is deducted)
ˆ Net pay (total after all deductions)
Any tax rates or factors should be declared as constants. Constants go before the main method but
inside the class. The position of OVERTIME_RATE in the code above shows the correct placement
for constants.

(c) After you have collected appropriate input from the user, use formatted output statements to
display a pay stub that looks exactly like the following. How to achieve this is discussed below: 

BlueJ: Terminal Window - HourlyPay
Options
Name: Tim Buctoo
Regular Hours: 40
Overtime Hours: 15
Gross Pay: $968.75
SS Withholding: $96.88
Federal Tax: $174.38
Net Pay: $697.50
Reg Rate: $15.50
OT Rate: $23.25
SSN: 111-11-1112
Reg Pay: $620.00
OT Pay: $348.75
x
111
Transcribed Image Text:BlueJ: Terminal Window - HourlyPay Options Name: Tim Buctoo Regular Hours: 40 Overtime Hours: 15 Gross Pay: $968.75 SS Withholding: $96.88 Federal Tax: $174.38 Net Pay: $697.50 Reg Rate: $15.50 OT Rate: $23.25 SSN: 111-11-1112 Reg Pay: $620.00 OT Pay: $348.75 x 111
Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 2 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY