1. Write a program to input the basic salary of a person. He get 15% of the basic as HRA, 7% of the basic as DA and 2% of the basic as Travel allowance. The total salary is calculated by adding Basic + HRA + DA + TA. The  PF is 10% of the basic salary. Calculate and print the total salary of person.
``````import java.io.*;
class salary
{
public static void main() throws IOException
{
String name="abc";
double HRA=(15*basic_salary)/100;
double DA=(7*basic_salary)/100;
double TA=(2*basic_salary)/100;
double PF=(10*basic_salary)/100;
double net_salary=basic_salary+HRA+DA+TA-PF;
System.out.println("Net salary is="+net_salary);
}
}
``````

10000 Net salary is=17700.0

2. Write a program to convert Hours , minutes and Seconds to Seconds.

``````import java.io.*;
class TIME
{
public static void main()throws IOException
{
System.out.println("Enter hours");
System.out.println("Enter minutes");
System.out.println("Enter seconds");
double mint=hr*60*60;
double seco=min*60;
double total_sec=mint+seco+sec;
System.out.println("Total seconds="+total_sec);
}
}
``````

3. Write a program to take a number (between 1 to 12) and print the name of the month and number of days of the month .

``````import java.io.*;
class months
{
public static void main()throws IOException
{
System.out.println("Enter a Number");
switch(val)
{
case 1:
System.out.println("January");
System.out.println("31 days");
break;
case 2:
System.out.println("February");
System.out.println("28 days");
break;
case 3:
System.out.println("March");
System.out.println("31 days");
break;
case 4:
System.out.println("April");
System.out.println("30 days");
break;
case 5:
System.out.println("May");
System.out.println("31 days");
break;
case 6:
System.out.println("June");
System.out.println("30 days");
break;
case 7:
System.out.println("July");
System.out.println("31 days");
break;
case 8:
System.out.println("August");
System.out.println("31 days");
break;
case 9:
System.out.println("September");
System.out.println("30 days");
break;
case 10:
System.out.println("October");
System.out.println("31 days");
break;
case 11:
System.out.println("November");
System.out.println("30 days");
break;
case 12:
System.out.println("December");
System.out.println("31 days");
break;
default:
System.out.println("Wrong choice.Give a value between 1 and 12.");
}
}
}
``````