Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. Create an applet payroll program named CalcPay that allows the user to enter

ID: 3819455 • Letter: 1

Question

1.      Create an applet payroll program named CalcPay that allows the user to enter Name, Hours, and rate. After the user enters the rate, hours, and name the program should calculate the gross pay. Compute federal withholding tax which is subtracted from gross based on the following table: Hints: (100pts) Use methods as deemed appropriate. 0 to 99.99 6% 100.00 to 299.99 12% 300.00 to 599.99 18% 600.00 and up 21%. Create an output file named '"Payout" The file should include: Name, hours, rate, deduct, gross and net. You are to process ten employees or stop the program by entering -999. Display the total amount of tax collected and the total gross and net for all employees.

2.      Write an applet program that would enter two variables in a text field and perform the following operations when calculate button is pressed. Design a friendly interface.

Addition

Multiplication

Division, division by zero is not allowed

Subtraction

Explanation / Answer

Solution of second question in java language:-

import java.awt.*;
import java.applet.*;
import java.awt.event.*;

publicclass textFieldDemo extends Applet
{
String str;
int a,b,sum,sub,div,mul;
TextField t1,t2;
Button btnCount;   
public void init()
{
t1=new TextField(10);
t2=new TextField(10);
add(t1);
add(t2);
btnCount = new Button("calculate");   
add(btnCount);
btnCount.addActionListener(this);
t1.setText("0");
t2.setText("0");
}

public void actionPerformed( ActionEvent evt) {
str=t1.getText();
a=Integer.parseInt(str);
str=t2.getText();
b=Integer.parseInt(str);
sum=a+b;
sub=a-b;
if(b!=0){
div=a/b;
}
mul=a*b;
// show the sum on the status bar of the browser's window
showStatus(" addition of two no.s=" + sum+" subtraction of two no.s="+sub+" division of two no.s="+div+" multiplication of two no.s="+mul);

}
}