I'm pretty new to programming and very new to java so please be patient.
Basically, I'm trying to get the user-implemented number (after going through the math) to be used as an index value within the array to find out which color it belongs to.
Example. The user submits an integer. Let's say 66. 66 mod 12 would be 6. Using 6 I can go throught the array where [6] is assigned to white and print out white.
Each color has 12 numbers. Blue 1-12, Orange 13-24 etc.
import java.util.Scanner;
import java.util.Arrays;
public class Main {
public static void main(String[] args) {
Scanner inputNum = new Scanner(System.in); // User inputs Intager
System.out.println("Enter Number...");
String[] fiberColors = {"Blue", "Orange", "Green", "Brown", "Slate", "White", "Red", "Black", "Yellow", "Violet", "Rose", "Aqua"};
int input = inputNum.nextInt(); // Read user input
if (input < 145) {
int modNum = (input- 1) % 12; // Find the modulus number from 12
for (int i = modNum; i == fiberColors.length; i++) {
System.out.println(fiberColors[i]);
}
if (input >= 145) {
System.out.println("Invalid Number/Over 144c"); // If user input is over 144 count
}
}
}
}