-
Notifications
You must be signed in to change notification settings - Fork 0
/
Main.java
59 lines (47 loc) · 1.77 KB
/
Main.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
/*Nathaniel Arquette
*class project
*The goal of this piece of code is to
*show an understanding of using file extensions
*and overrides
*/
import java.util.Scanner;
public class Main {
public static void main(String[] args) {
//what do we want?
System.out.println("Please enter a basic color to test.");
Scanner sc = new Scanner(System.in);
String test = sc.next();
//tell em what they entered
Test(test);
//we want more
System.out.println("Please enter another basic color to test.");
String test2 =sc.next();
//tell em what they entered
Test(test2);
//magic is gonna happen!
System.out.println("Mixing colors.");
Test call = new Test();
call.Test(test, test2);
}
//this is how we tell them what they entered
private static void Test(String test) {
//primary
if (test.equalsIgnoreCase("blue")||
test.equalsIgnoreCase("red")||
test.equalsIgnoreCase("yellow"))
{System.out.println(test + " is a primary color.");}
else System.out.println(test + " is not a primary color.");
//cool
if (test.equalsIgnoreCase("blue")||
test.equalsIgnoreCase("green")||
test.equalsIgnoreCase("purple"))
{System.out.println(test + " is a cool color.");}
else System.out.println(test + " is not a cool color.");
//warm
if (test.equalsIgnoreCase("red")||
test.equalsIgnoreCase("yellow")||
test.equalsIgnoreCase("orange"))
{System.out.println(test + " is a warm color.");}
else System.out.println(test + " is not a warm color.");
}
}