package array;
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
public class linlin {
public static void main(String[] args) {
String s1="";
String s2="";
String s3="";
try{
BufferedReader in = new BufferedReader(new InputStreamReader(System.in));
System.out.print("Age = ");
s1 = in.readLine();
System.out.print("Sex = ");
s2 = in.readLine();
System.out.print("Comm = ");
s3 = in.readLine();
}catch (IOException e){}
int age = Integer.parseInt(s1);
String sex = s2;
// int sex = Integer.parseInt(s2);
double comm = Double.parseDouble(s3);
System.out.println("The actual result is: "+Sample(age,sex,comm));
}
static double Sample(int age,String sex,double comm){
if (( age > 25 )&&( sex == "M" )){
comm = comm + 150;
}
if ((age > 50)||( comm > 2000.00)){
comm = comm - 200;
}
return comm;
}
}