PANCHO, Ciandra V.
Data Structure - Algorithm
IT21S2 CITE004
1. PSEUDOCODE
2. SOURCE CODE
package dataStructures;
import [Link];
public class Salary {
public static void main(String[] args) {
Scanner scan = new Scanner([Link]);
[Link]("Enter value of INCOME: ");
int income = [Link]();
[Link]("Enter value of COST: ");
int cost = [Link]();
[Link]();
if(income>=cost) {
int profit = income - cost;
[Link]("\nPROFIT: "+profit);
}
else {
int loss = cost - income;
[Link]("\nLOSS: "+loss);
}
}
}
3. OUTPUT
- if income is greater than or equal to cost
-else income is not greater than or equal to cost