write a algorithm in pseudocode for the procedure: input a person's age and salary. If the age is over 32, then add $1000 to the salary but otherwise subtract $500 from the salary. Finally, output the age and new salary: this is the question:
here is the answer well the code that I use, am wondering if i did it correctly:
Scanner scan = new Scanner (System.in);
int age, salary, sum, difference;
System.out.println("Please enter the person age");
age = scan.nextInt();
System.out.println("Please enter the person salary");
salary = scan.nextInt();
if(age>32)
{
sum = salary + 1000;
System.out.println("the age is " + age);
}
else if(age<32)
{
difference = salary - 500;
System.out.println("the new salary is");