courseworkhero.co.uk

 Required: 1)  Create a Java Program to calculate the net pay for an employee. 2)  In this payroll program, you will need to allow the user to input the following information: Input your First Name: Elmer Input your Last Name: Fudd Input the Amount of Hours Worked: 10.0 Input the Hourly Rate:10.0 3)  Pay attention to the data types of the First Name and Last Name (character) and the Hours Worked and Hourly Rate (numeric). 4)  Note that the federal taxes are calculated at 15% of gross pay and state taxes are calculated at 8% of gross pay. 5)  The following output is expected: Payroll Information for Fudd, Elmer: {blank line} Hours Worked: Hourly Rate: {blank line} Gross Pay: Federal Taxes: State Taxes: Net Pay: 10.00 10.00 100.00 15.00 8.00 —— 77.00 6)  All shop standards are to be followed as instructed in class. 7)  The output listed above must be mathematically correct, however, formatting of the numbers with the decimal places and right justification is not required. 8)  Save the source code as “mrwJavaProg02.java”. 9)  You will submit the Java file to the Dropbox for this lab assignment on or before the due date. Enrichment (not required for the lab): 1) Display all numerical amounts above with a forced two decimal places. 2) Display all numerical amounts above with commas where appropriate (i.e. if the gross pay was 1100, you would display it as 1,100.00 3) Force the display to be right justified.  

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper

/************************************************/
/* Your Name */
/* Week 2 Programming Example */
/* Due Date: ______________________________ */
/* CS 151- Introduction to Programming */
/************************************************/
// This program will accept the input of the width and length of a rectangle
// and output the perimeter and area.
//Pseudocode:
//1) Input the length of the rectangle
//2) Input the width of the rectangle
//3) Calculate the perimeter = 2 * (length + width)
//4) Calculate the area = length * width
//5) Output the perimeter of the rectangle
//6) Output the area of the rectangle
import java.util.*;
import java.text.*;
public class mrwJavaWeek02Example {

public static void main(String[] args) {
Scanner stdIn = new Scanner(System.in); //Class reference to allow input from the console
double length = 0; //Length of a rectangle
double width = 0; //Width of a rectangle
double perimeter = 0; //Perimeter of the rectangle
double area = 0; //Area of the rectangle
//Step 1
System.out.print(“Input the length of the rectangle: “);
length = stdIn.nextDouble();
//Step 2
System.out.print(“Input the width of the rectangle: “);
width = stdIn.nextDouble();
//Step 3
perimeter = 2 * (length + width);
//Step 4
area = length * width;
//Step 5 – Added blank lines with println() statements
System.out.println();
System.out.println();
System.out.println(“The perimeter of the rectangle is: ” + perimeter);
//Step 6 – Added blank lines with println() statements
System.out.println();
System.out.println();
System.out.println(“The area of the rectangle is: ” + area);

} //end main
}

Save Time On Research and Writing
Hire a Pro to Write You a 100% Plagiarism-Free Paper.
Get My Paper
Still stressed from student homework?
Get quality assistance from academic writers!

Order your essay today and save 25% with the discount code LAVENDER