Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

X Flat Available For Rent Civic Cen + S76 View Robinhood Extensions PROJECT Selection Control with Java - Differential Piecework Schedule Obiective To construct a

image text in transcribedimage text in transcribedimage text in transcribedimage text in transcribedimage text in transcribed

X Flat Available For Rent Civic Cen + S76 View Robinhood Extensions PROJECT Selection Control with Java - Differential Piecework Schedule Obiective To construct a program that demonstrates selection program control. PROJECT DESCRIPTION Selection program control occurs when code statements are executed depending on certain conditions. Type, compile and run a computer program that uses selection control structures and that receives an employee's work production and passes this to a differential piecework schedule data, according to the information given below. and then determines the gross pay amount. Observe the output and then modify the program. Some skeletal program code is shown in Figure 1. which follows. Information About This Project Employees who manufacture items are often paid based on the number of the items they produce. Some employees are paid a flat rate per item and others are paid via a differential piecework schedule, as illustrated in the following example. Note: a differential piecework schedule is based on the employee's productivity Example Compute Linda's gross pay if she produced 372 shirts. The rate per shirt is given by the differential piecework schedule below: Pay Level Items Produced Rate per Item 1 001 - 112 2 $ 7.15 $ 7.45 $ 7.95 $ 8.40 113 - 150 151 - 217 over 217 3 4 Solution Linda's gross pay is computed via this numerical pay schedule. Pay Level Items Produced Rate per Item Amount Pay 1 2 3 4 112 38 67 155 $ 7.15 $ 7.45 $ 7.95 $ 8.40 $ 800.80 $ 283.10 $ 532.65 $ 1,302.00 total 372 gross pay $ 2,918.55 The Input, Process and Output (IPOS ) requirements of this project are: Input the employee name, the number of items produced and the type of pay schedule ( flat rate or differential piecework) 1 5 View as Text X -241-OC + Flat Available For Rent Civic Cen content/2350746/View eritrade Robinhood Extensions CSC 241 Lab 2 Java Data Structures Process the employee gross pay Output the employee name, the number of items produced, the type of pay schedule and the gross pay Required all dollar amounts displayed in a currency format PROJECT Selection Control with Java - Differential Piecework Schedule Steps to Complete This Project STEP 1 Open an Integrated Development Environment (IDE) Open Eclipse, Net Beans, MS Visual Studio, VS Code or similar programming text editor compiler. STEP 2 Write the Program Code Write the program code that will satisfy the requirements of this project. That is a program that will request the employee's name, the number of items produced and the type of pay schedule flat rate or differential piecework). You can assume a rate of $ 7.50 per unit for the flat rate pay schedule and then use the differential piecework as given in the example, shown earlier. When writing your code statements, use both sequential and selection program control and avoid the use of any looping structures. You can use one if / else block for the flat rate pay schedule and one if / else if/else block for the differential scales. Into your Code window, copy the program code shown in Figure 1 Substitute your own name in place of Sammy Student, as the program writer. Figure 1 Program Code for the GrossPay Application import java.text. Number Format; import java.text.SimpleDateFormat; import java.util.Date; public class GrossPay { public static void main(String[] args) { // declare an object that will display two decimal digits Number Format nf = Number Format.getCurrency Instance(); // declare an object that will display the current date Date myDate = new Date(); String myDateFormat - "MM/dd/yyyy"; SimpleDateFormat dt Today = new SimpleDateFormat (myDateFormat); System.out.println("Today's Date is: " + dt Today.format(myDate)); 2 15 View as Text Downloa Flat Available For Rent Civic Cen X + nt/2350746/View Robinhood Extensions CSC 241 Java Data Structures Lab 2 + Il display the name of the programmer System.out.println(" Programmer: Sammy Student "); // display a dummy value to show that two decimals are obtained System.out.println(" test amount: + nf.format(2.575)); } } PROJECT Selection Control with Java - Differential Piecework Schedule The above starter code will display the current date and the name of the programmer. It also writes a dummy test value to show that the two decimal format will display currency values, when it is used later in the program STEP 3 Build, Compile and Run the Program Compile and run your program code statements. Correct any syntax or compile errors. STEP 4 Test the Program Once you have successfully compiled your program, use the following data, when prompted into the output Console window of your application Name of Employee : (enter your own name) Type of Pay Schedule: (choose flat or differential ) Units Produced : 372 show your STEP 5 Verify Your Output When you enter the above information, the Console window should program output. Verify that the output is numerically accurate and that the required output information is displayed. Use separate program runs to compare the gross pay when the flat rate is selected and when the differential piecework schedule is selected, STEP 6 Modify Your Program Return to your Code window and supplement the program with even more additional code statements. Place the new statements before the close of your main() method. 3 15 View as Text Flat Available For Rent Civic Cen X + 1/2350746/View Robinhood Extensions . based on the The new statements will accomplish these tasks. Compute and display the employee's Medicare tax, which is gross pay amount. Use a Medicare rate of 1.45% Compute and display the employee's FICA tax, which is based gross pay amount. Use a FICA rate of 6.20 %. Compute and display the employee's Federal tax (FIT), which on the gross pay amount. Assume a flat tax rate on the is based of 25 % Calculate and display the employee's net pay, which is their gross pay less any taxes. STEP 7 Test the Program Once you have successfully compiled your program, use the following data, when prompted, into the output Console window application of your PROJECT Selection Control with Java - Differential Piecework Schedule Program Run 1 Name of Employee : (enter your own name) Type of Pay Schedule : (choose flat rate) Units Produced : 372 Program Run 11 Name of Employee : (enter your own name ) Type of Pay Schedule : (choose differential piecework) Units Produced : 372 STEP 8 Submit Your Project Once you have determined that your modified program is satisfying this project's requirements, complete the submission process as follows: Open MS Word and type a heading for a new document that includes your full name, course number, lab number and date. Within the document paste a snapshot of your program code. Label your snapshot with a reasonable description. After the snapshot, paste the output that appears in your Console 4 52 View as Text 2350746Niew Robinhood * Extensions CSC 241 Java Data Structures Lab 2 screen. Use multiple screen snapshots for the output when there are different output possibilities for different inputs. Note - you can use the Windows Snipping Tool, which is part of the Accessories Group, to easily capture your Console Windows window. X Snipping Tool New - X Cancel Options Select a snip type from the menu or click the New button Your score for this project will generally be based upon the following factors: documentation, output correctness, content, organization, style and creativity. Submit your Word document to the appropriate course Submittal Box. STEP 9 Questions and Answers Concerning this Computer Project Answer the following questions in your own words. Open MS Word and, within your lab submittal document, place your responses to each of these questions. Submit your completed MS Word document for credit PROJECT Selection Control with Java - Differential Piecework Schedule (1) What is meant by selection program control? How does it differ from sequential program control? (2) How is selection program control used in this application? (3) What is meant by a Differential Piecework Schedule? (4) which primitive data type was used more frequently within your completed code for this application? (5) blocks this application? Instead of using if / else blocks, could switch/case code have been incorporated within your completed code for Explain your answer X Flat Available For Rent Civic Cen + S76 View Robinhood Extensions PROJECT Selection Control with Java - Differential Piecework Schedule Obiective To construct a program that demonstrates selection program control. PROJECT DESCRIPTION Selection program control occurs when code statements are executed depending on certain conditions. Type, compile and run a computer program that uses selection control structures and that receives an employee's work production and passes this to a differential piecework schedule data, according to the information given below. and then determines the gross pay amount. Observe the output and then modify the program. Some skeletal program code is shown in Figure 1. which follows. Information About This Project Employees who manufacture items are often paid based on the number of the items they produce. Some employees are paid a flat rate per item and others are paid via a differential piecework schedule, as illustrated in the following example. Note: a differential piecework schedule is based on the employee's productivity Example Compute Linda's gross pay if she produced 372 shirts. The rate per shirt is given by the differential piecework schedule below: Pay Level Items Produced Rate per Item 1 001 - 112 2 $ 7.15 $ 7.45 $ 7.95 $ 8.40 113 - 150 151 - 217 over 217 3 4 Solution Linda's gross pay is computed via this numerical pay schedule. Pay Level Items Produced Rate per Item Amount Pay 1 2 3 4 112 38 67 155 $ 7.15 $ 7.45 $ 7.95 $ 8.40 $ 800.80 $ 283.10 $ 532.65 $ 1,302.00 total 372 gross pay $ 2,918.55 The Input, Process and Output (IPOS ) requirements of this project are: Input the employee name, the number of items produced and the type of pay schedule ( flat rate or differential piecework) 1 5 View as Text X -241-OC + Flat Available For Rent Civic Cen content/2350746/View eritrade Robinhood Extensions CSC 241 Lab 2 Java Data Structures Process the employee gross pay Output the employee name, the number of items produced, the type of pay schedule and the gross pay Required all dollar amounts displayed in a currency format PROJECT Selection Control with Java - Differential Piecework Schedule Steps to Complete This Project STEP 1 Open an Integrated Development Environment (IDE) Open Eclipse, Net Beans, MS Visual Studio, VS Code or similar programming text editor compiler. STEP 2 Write the Program Code Write the program code that will satisfy the requirements of this project. That is a program that will request the employee's name, the number of items produced and the type of pay schedule flat rate or differential piecework). You can assume a rate of $ 7.50 per unit for the flat rate pay schedule and then use the differential piecework as given in the example, shown earlier. When writing your code statements, use both sequential and selection program control and avoid the use of any looping structures. You can use one if / else block for the flat rate pay schedule and one if / else if/else block for the differential scales. Into your Code window, copy the program code shown in Figure 1 Substitute your own name in place of Sammy Student, as the program writer. Figure 1 Program Code for the GrossPay Application import java.text. Number Format; import java.text.SimpleDateFormat; import java.util.Date; public class GrossPay { public static void main(String[] args) { // declare an object that will display two decimal digits Number Format nf = Number Format.getCurrency Instance(); // declare an object that will display the current date Date myDate = new Date(); String myDateFormat - "MM/dd/yyyy"; SimpleDateFormat dt Today = new SimpleDateFormat (myDateFormat); System.out.println("Today's Date is: " + dt Today.format(myDate)); 2 15 View as Text Downloa Flat Available For Rent Civic Cen X + nt/2350746/View Robinhood Extensions CSC 241 Java Data Structures Lab 2 + Il display the name of the programmer System.out.println(" Programmer: Sammy Student "); // display a dummy value to show that two decimals are obtained System.out.println(" test amount: + nf.format(2.575)); } } PROJECT Selection Control with Java - Differential Piecework Schedule The above starter code will display the current date and the name of the programmer. It also writes a dummy test value to show that the two decimal format will display currency values, when it is used later in the program STEP 3 Build, Compile and Run the Program Compile and run your program code statements. Correct any syntax or compile errors. STEP 4 Test the Program Once you have successfully compiled your program, use the following data, when prompted into the output Console window of your application Name of Employee : (enter your own name) Type of Pay Schedule: (choose flat or differential ) Units Produced : 372 show your STEP 5 Verify Your Output When you enter the above information, the Console window should program output. Verify that the output is numerically accurate and that the required output information is displayed. Use separate program runs to compare the gross pay when the flat rate is selected and when the differential piecework schedule is selected, STEP 6 Modify Your Program Return to your Code window and supplement the program with even more additional code statements. Place the new statements before the close of your main() method. 3 15 View as Text Flat Available For Rent Civic Cen X + 1/2350746/View Robinhood Extensions . based on the The new statements will accomplish these tasks. Compute and display the employee's Medicare tax, which is gross pay amount. Use a Medicare rate of 1.45% Compute and display the employee's FICA tax, which is based gross pay amount. Use a FICA rate of 6.20 %. Compute and display the employee's Federal tax (FIT), which on the gross pay amount. Assume a flat tax rate on the is based of 25 % Calculate and display the employee's net pay, which is their gross pay less any taxes. STEP 7 Test the Program Once you have successfully compiled your program, use the following data, when prompted, into the output Console window application of your PROJECT Selection Control with Java - Differential Piecework Schedule Program Run 1 Name of Employee : (enter your own name) Type of Pay Schedule : (choose flat rate) Units Produced : 372 Program Run 11 Name of Employee : (enter your own name ) Type of Pay Schedule : (choose differential piecework) Units Produced : 372 STEP 8 Submit Your Project Once you have determined that your modified program is satisfying this project's requirements, complete the submission process as follows: Open MS Word and type a heading for a new document that includes your full name, course number, lab number and date. Within the document paste a snapshot of your program code. Label your snapshot with a reasonable description. After the snapshot, paste the output that appears in your Console 4 52 View as Text 2350746Niew Robinhood * Extensions CSC 241 Java Data Structures Lab 2 screen. Use multiple screen snapshots for the output when there are different output possibilities for different inputs. Note - you can use the Windows Snipping Tool, which is part of the Accessories Group, to easily capture your Console Windows window. X Snipping Tool New - X Cancel Options Select a snip type from the menu or click the New button Your score for this project will generally be based upon the following factors: documentation, output correctness, content, organization, style and creativity. Submit your Word document to the appropriate course Submittal Box. STEP 9 Questions and Answers Concerning this Computer Project Answer the following questions in your own words. Open MS Word and, within your lab submittal document, place your responses to each of these questions. Submit your completed MS Word document for credit PROJECT Selection Control with Java - Differential Piecework Schedule (1) What is meant by selection program control? How does it differ from sequential program control? (2) How is selection program control used in this application? (3) What is meant by a Differential Piecework Schedule? (4) which primitive data type was used more frequently within your completed code for this application? (5) blocks this application? Instead of using if / else blocks, could switch/case code have been incorporated within your completed code for Explain your

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

User can this work: p ( q r ) q ( p r )

Answered: 1 week ago

Question

Find the derivative of y= cos cos (x + 2x)

Answered: 1 week ago

Question

Is SHRD compatible with individual career aspirations

Answered: 1 week ago