I'm trying to create new variables in Java based on comparison operators (three different variables: one for less than, one for greater than, and one for equal to) to examine the difference between two variables between two years
The data is organized in two categories for two years that add up to 100 for each year, as shown below:
2018 X=70% 2019 X=20%
2018 Y=30% 2019 Y=80%
I want to make the following statements for both x and y:
- If x 2019 is greater x 2018, then new_variable_decrease
- If x 2019 is less than x 2018, then new_variable_decrease
- If x 2019 is equal to x 2018, then new_variable_no_change
I am new to Java, but this is what I tried and setting a new variable with int and an if statement (which didn't run in the program I'm using-Q)
int new_variable_increase;
if (x2019 > x2018) {new_variable_increase}
int new_variable_increase;
if (x2019 > x2018) {new_variable_increase}
Aucun commentaire:
Enregistrer un commentaire