Program Statement:
Write a Applet program that calculates DA , HRA ,CCA and GS of employee using
following information 1)if  Basic Salary(BS) is <5000 then DA= 81% of BS
2) if BS is in range 5000 to 7000 then DA=51% of BS
3) if BS is > 7000 then DA=41% OF BS
CCA =350/-
HRA=15% OF BS
source file name:  AppletParamSalaryDemo.java
/*
<html>
<body>
<applet code=AppletParamSalaryDemo.class width=550 height=300 >
<param name="salary" value="12000" > // input value
</applet>
<body>
<html>
*/
import java.awt.*;
import java.applet.*;
public class AppletParamSalaryDemo extends Applet
{
int bs,cca;
Font f1;
double da,hra,gs;
public void init()
{
bs=Integer.parseInt(getParameter("salary"));
f1=new Font("Courier", Font.BOLD,20);
}
public void paint(Graphics g)
{
g.setFont(f1);
if(bs<5000)
da=bs*0.81;
if(bs>=5000 && bs< 7000)
da=bs*0.51;
if(bs> 7000)
da=bs*0.41;
 cca=350;
hra=bs*0.15;
gs=bs+da+cca+hra;
// displaying Basic Salary, DA, CCA, HRA and Gross Salary values on screen
g.drawString("Basic Salary is: "+bs,100,100);
g.drawString("DA  is: "+da,100,125);
g.drawString("CCA is: "+cca,100,150);
g.drawString("HRA is: "+hra,100,175);
g.drawString("Gross Salary is: "+gs,100,200);
}
}

output: