I am trying to make a program where you can enter a credit card number and it will spit out the number back at you with a ASCII letter/symbol on the end using the remainder of the added digits divided by 26. I feel like my code is right although when I run the program, no symbol shows up. I do not get debug errors or anything, but my (char) symbol just doesn't show up. All it shows is the numbers. Can someone help me please?
Here is what I have so far:
import java.util.*;
import java.text.*;
import java.math.*;
public class Program{
public static void main (String []args){
Scanner keyboard = new Scanner(System.in);
int CC, CC2, CC3, CC4;
System.out.println("Enter your credit card number 2 numbers at a time (XX XX XX XX)");
CC=keyboard.nextInt();
CC2=keyboard.nextInt();
CC3=keyboard.nextInt();
CC4=keyboard.nextInt();
int CC6;
CC6= (CC+CC4+CC2+CC3)%26;
char CC7;
CC7 = (char)CC6;
System.out.println("The correct number and code is:" +CC+CC2+CC3+CC4+CC7);
}
}