# some Java programs part 3

//11//Question: Write a program to compute and display a person’s weekly salary as determined by the following conditions: If the hours worked are less than or equal to 40, the person receives Tk200.00 per hour, else the person receives Tk8000.00 plus Tk300.00 for each hour worked over 40 hours.

```/* Time: 11.35am
* Author: Anik Das
* Question: Write a program to compute and display a person’s weekly salary as determined by
* the following conditions: If the hours worked are less than or equal to 40, the person receives
* Tk200.00 per hour, else the person receives Tk8000.00 plus Tk300.00
* for each hour worked over 40 hours.*/
import java.util.Scanner;
public class Faraz11{
public static void main (String args []){
int workHr, sal=0;
Scanner input = new Scanner ( System.in );
workHr = input.nextInt();
if ( workHr&lt;=40 ){       sal = workHr*200;     }     if ( workHr&gt;40 ){
sal = 8000 + 300*( workHr - 40 );
}
System.out.println(&quot;Yor Sallery Is : Taka &quot;+sal);
}
}

```

//12// question: Write a program, given an “amount” of money. It shows it split into 500, 100, 50, 20, 10, 5, 2 and 1 taka bills or coins. The output would be: Say for 1234 it says:

• 500 Taka: 2 note(s)
• 100 Taka: 2 note(s)
• 50 Taka: 0 note(s)
• 20 Taka: 1 note(s)
• 10 Taka: 1 note(s)
• 5 Taka: 0 note(s)
• 2 Taka: 2 note(s)
• 1 Taka: 0 note(s)
```/* Time: 12:01pm
* Author: Anik Das
* question: Write a program, given an “amount” of money.
* It shows it split into 500, 100, 50, 20, 10, 5, 2 and 1 taka bills or coins. The output would be:
Say for 1234 it says:
500 Taka: 2 note(s)
100 Taka: 2 note(s)
50 Taka: 0 note(s)
20 Taka: 1 note(s)
10 Taka: 1 note(s)
5 Taka: 0 note(s)
2 Taka: 2 note(s)
1 Taka: 0 note(s)*/
import java.util.Scanner;
public class Faraz12 { //original MoneySplit
public static void main (String[]args) {
int oneTaka=0, twoTaka=0, fiveTaka=0, tenTaka=0;
int twentyTaka=0, fiftyTaka=0, hundredTaka=0, fiveHundredTaka=0;
int amount;
Scanner input = new Scanner ( System.in );
amount = input.nextInt();
int K=amount%500;
fiveHundredTaka = (amount - K)/500;
int A=K%100;
hundredTaka=(K-A)/100;
int B=A%50;
fiftyTaka=(A-B)/50;
int C=B%20;
twentyTaka=(B-C)/20;
int D=C%10;
tenTaka=(C-D)/10;
int E=D%5;
fiveTaka=(D-E)/5;
int F=E%2;
twoTaka=(E-F)/2;
int G=F%1;
oneTaka=(F-G)/1;
System.out.println(&quot;500 Taka: &quot;+fiveHundredTaka+&quot; note(s)n100 Taka: &quot;+hundredTaka+&quot; note(s)n50 Taka: &quot;+fiftyTaka+&quot; note(s)n20 Taka: &quot;+twentyTaka+&quot; note(s)n10 Taka: &quot;+tenTaka+&quot; note(s)n5 Taka: &quot;+fiveTaka+&quot; note(s)n2 Taka: &quot;+twoTaka+&quot; note(s)n1 Taka: &quot;+oneTaka+&quot; note(s)&quot;);
}
}

```

//13// Suppose the following expressions are used to calculate the values of L for different values of S:
L = 12000/(4+(s*s/14900))

```/*Time: 4:39pm
* Author: Anik Das*/
import java.util.Scanner;
public class Faraz14{
public static void main ( String [] args){
double s=0, l=0;
Scanner input = new Scanner ( System.in );
System.out.println(&quot;Enter The Value Of S :&quot;);
s = input.nextInt();
l=12000/(4+(s*s/14900));
System.out.println(&quot;The Value Of L is : &quot;+l);
}
}
```

//15//Write a program that reads the values for the three sides x, y, and z of a triangle, and then calculates its area. The area is calculated as follows:

area = √(s*(s-x)*(s-y)*(s-z))

where s is (x+y+z)/2

```/*Time: 4:46pm
* Author: Anik Das*/
import java.util.Scanner;
public class Faraz15{
public static void main ( String [] args ){
double area=0, c=1, s, x=0, y=0, z=0;
Scanner input = new Scanner ( System.in );
System.out.println(&quot;Enter The Value of The 1st Side&quot;);
x=input.nextDouble();
System.out.println(&quot;Enter The Value of The 2nd Side&quot;);
y=input.nextDouble();
System.out.println(&quot;Enter The Value of The 3rd Side&quot;);
z=input.nextDouble();
s=(x+y+z)/2;
area = Math.sqrt(s*(s-x)*(s-y)*(s-z));
System.out.println(&quot;Area Of the Triangle Is : &quot;+area);
}
}
```