For your purposes, it seems fine. If you wanted to "go the extra mile" and pretty up the output a bit, you could format the total appropriately before you print it. By that, I mean you could make it so only the first two decimal places are displayed (since that is usually how you would see money displayed). You can do that quite easily with the NumberFormat class.
Here is a brief example of how it works:
double money = 100.25789;
NumberFormat formatter = NumberFormat.getCurrencyInstance();
String moneyString = formatter.format(money);
System.out.println("The money amount is "+moneyString); // This will print out: The money amount is $100.26
Another common practice, is not using double for money. Since you are probably not dealing with "real" money, it isn't an issue. But in real-world applications where money precision is important (like an application for a Bank), the BigDecimal class is recommended by most people. This is because there can be small mathematical mistakes with doubles due to something called "floating-point arithmetic" and because the computer cannot always accurately store a base 10 decimal number as bits. An example of this error can be seen if you run this basic code:
double number = 0.1 * 0.1;
We know that the answer to that should be 0.01, but due to how the computer stores the number "0.1", the computer will give the result: 0.010000000000000002
It's just a fun little fact you might see on an exam or something some day, lol.