import java.io.*;
public class bonus{
public static InputStreamReader reader=new InputStreamReader(System.in);
public static BufferedReader input=new BufferedReader(reader);
public static void main(String[] args) throws Exception{
double salary,bonus;
System.out.println("Enter Employee's Monthly Salary: ");
salary=Double.parseDouble(input.readLine());
if(salary>=6000){
System.out.println("The bonus is 6000");
}
else
{
bonus=salary*.5;
System.out.println("The bonus is "+bonus);
}
}
}
}
// It only executes the System.out.println("Enter Employee's Monthly Salary: "); salary=Double.parseDouble(input.readLine());
//it does not executes the if - else block statements.....
//sample dialogue....
// Enter Employee's Monthly Salary:
//6000
lloydsbackyard 0 Light Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
stephen84s 550 Nearly a Posting Virtuoso Featured Poster
JamesCherrill 4,733 Most Valuable Poster Team Colleague Featured Poster
lloydsbackyard 0 Light Poster
lloydsbackyard 0 Light Poster
lloydsbackyard 0 Light Poster
masijade 1,351 Industrious Poster Team Colleague Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.