InputMismatchException means that the stream is looking at the wrong kind of input. It is a runtime error (not a compiler message) and it is occurring when you call nextDouble().
Basically you enter "=", the runtime tries to read that as a double, and you get the exception.
You may have noticed that your code *never* stops and waits for you to enter a value for
svalota. This becomes even clearer if you print some prompts:
for (i = 0; svalota.equals("=") == false; i++) {
Scanner addend = new Scanner(System.in);
System.out.print("Enter a double: ");
add[i] = addend.nextDouble();
System.out.print("Enter svalota");
svalota = addend.nextLine();
}
And the reason for that is that nextDouble() returns a double but
does not move to the next line. So nextLine() will always return straight away and assign an empty string to
svalota. It will do this every time. The answer is to read a new line after nextDouble(). You don't do anything with what is read (it is an empty string) but it "positions" the stream properly:
import java.util.Scanner;
public class Calc {
public static void main(String pizdets[]) {
double[] add = new double[100];
double total = 0;
int i = 0;
String svalota = "";
for (i = 0; svalota.equals("=") == false; i++) {
Scanner addend = new Scanner(System.in);
add[i] = addend.nextDouble(); // read the double
addend.nextLine(); // throw away the newline
svalota = addend.nextLine(); // read = to stop, or something else to continue
}
for (i = 0; i < add.length; i++) {
total += add[i];
}
System.out.print(total);
}
}