You are on page 1of 3

PANCHO, Ciandra V.

Data Structure - Algorithm

IT21S2 CITE004

1. PSEUDOCODE
2. SOURCE CODE

package dataStructures;

import java.util.Scanner;

public class Salary {


public static void main(String[] args) {

Scanner scan = new Scanner(System.in);

System.out.println("Enter value of INCOME: ");


int income = scan.nextInt();

System.out.println("Enter value of COST: ");


int cost = scan.nextInt();

scan.close();

if(income>=cost) {
int profit = income - cost;
System.out.println("\nPROFIT: "+profit);
}

else {
int loss = cost - income;
System.out.println("\nLOSS: "+loss);

}
}

}
3. OUTPUT

- if income is greater than or equal to cost

-else income is not greater than or equal to cost

You might also like