I initialize the salary and this is the result i get, is it correct, to me it doesnt look correct, I could be wrong
public static void main(String[] args) {
Scanner scan = new Scanner (System.in);
int age, sum, difference, old_salary, new_salary, salary = 0;
System.out.println("Please enter the person age");
age = scan.nextInt();
System.out.println("Please enter the person old salary");
old_salary = scan.nextInt();
System.out.println("Please enter the person new salary");
new_salary = scan.nextInt();
if(age > 32)
{
sum = old_salary + 1000;
System.out.println("your salary is " + salary );
}
else if (age<=32)
{
old_salary = new_salary - 500;
difference = old_salary - 500;
System.out.println("your new salary is " + salary);
System.out.println("your age is " + age);
this is the result I get when I run the program. when I test it with the age 29 which is less than 32 and when i test it with 33 which is greater than 32, i used random salary range. checking to see if it run and this is the result. i could be wrong but is this the correct answer
Please enter the person age
29
Please enter the person old salary
3000
Please enter the person new salary
4000
your new salary is 0
your age is 29
BUILD SUCCESSFUL (total time: 9 seconds)