I am struggling through writing this program that I have started. When I compile it to see if I have everything right java tells me that it cannot find the symbol I defined earlier. If anyone could take a look at my program and give me some advice that would be awesome.
Here it is:
public class CreditCard {
private String number; //The Credit Card number is kept as a string
private boolean valid;
public CreditCard(String n){
number=n;
valid=true;
}
private void check2(){
int v1=Integer.parseInt(number.substring(6,7));
int v1d = v1*2;
if(v1d<=9){
int v1d1 = v1d%10;
(int) v1d2 = v1d/10;
}
else{
int v1d3 = v1d;
}
int v2=Integer.parseInt(number.substring(4,5));
int v2d = v2*2;
if(v2d<=9){
int v2d1 = v2d%10;
(int) v2d2 = v2d/10;
}
else{
int v2d3 = v2d;
}
int v3=Integer.parseInt(number.substring(2,3));
int v3d =v3*2;
if(v3d<=9){
int v3d1 = v3d%10;
(int) v3d2 = v3d/10;
}
else{
int v3d3 = v3d;
}
int v4=Integer.parseInt(number.substring(0,1));
int v4d = v4*2;
if(v4d<=9){
int v4d1 = v4d%10;
(int) v4d2 = v4d/10;
}
else{
int v4d3 = v4d;
}
int c1 = (v4d1 + v3d1 + v2d1 + v1d1 + v4d2 + v3d2 + v2d2 + v1d2 + v4d3 $
}
}
