- Joined
- Jul 1, 2017
- Posts
- 1,430
- Reaction
- 3,681
- Points
- 994
Help naman po 'di ko sure kung tama yung code ko. Laging "Green" kasi yung results. 'di ko na kaya huhu help poo
import java.util.*;
public class Color_Selection {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int b = 1;
int y = 2;
int r = 3;
System.out.println("\n");
System.out.println("\tChoose your primary colors here ");
System.out.println(" 1 = blue\n 2 = yellow\n 3 = red\n ");
System.out.println("\n");
int colors;
System.out.println("\tEnter a Combination Color 1 : ");
colors= sc.nextInt();
System.out.println("\tEnter a Combination Color 2 : ");
colors= sc.nextInt();
System.out.println("\n");
if (1 != 2) {
System.out.println("\tThe result color is Green.");
}
else if (2 != 1) {
System.out.println("\tThe result color is Green.");
}
else if (2 != 3) {
System.out.println("\tThe result color is Orange.");
}
else if (3 != 2) {
System.out.println("\tThe result color is Orange.");
}
else if (3 != 1) {
System.out.println("\tThe result color is Violet.");
}
else if (1 != 3) {
System.out.println("\tThe result color is Violet.");
}
else {
System.out.println("\tWrong Color Combination. Try Again.");
}
System.out.println();
System.out.println("\tEnd of Program");
System.out.println("\n");
sc.close();
}
}
You do not have permission to view the full content of this post. Log in or register now.
import java.util.*;
public class Color_Selection {
public static void main(String[] args) {
Scanner sc= new Scanner(System.in);
int b = 1;
int y = 2;
int r = 3;
System.out.println("\n");
System.out.println("\tChoose your primary colors here ");
System.out.println(" 1 = blue\n 2 = yellow\n 3 = red\n ");
System.out.println("\n");
int colors;
System.out.println("\tEnter a Combination Color 1 : ");
colors= sc.nextInt();
System.out.println("\tEnter a Combination Color 2 : ");
colors= sc.nextInt();
System.out.println("\n");
if (1 != 2) {
System.out.println("\tThe result color is Green.");
}
else if (2 != 1) {
System.out.println("\tThe result color is Green.");
}
else if (2 != 3) {
System.out.println("\tThe result color is Orange.");
}
else if (3 != 2) {
System.out.println("\tThe result color is Orange.");
}
else if (3 != 1) {
System.out.println("\tThe result color is Violet.");
}
else if (1 != 3) {
System.out.println("\tThe result color is Violet.");
}
else {
System.out.println("\tWrong Color Combination. Try Again.");
}
System.out.println();
System.out.println("\tEnd of Program");
System.out.println("\n");
sc.close();
}
}
You do not have permission to view the full content of this post. Log in or register now.