How can voltage of a battery be calculated?
The open-circuit voltage of a battery is based on the electrochemical potentials of the constituent materials. The theoretical voltage is determined by the Nernst Equation. You can look up the half-cell potentials. There is a temperature dependence which the Nernst Equation will predict.  

Here is a simple undergrad lab where the students are asked to work this out for an ordinary lead-acid battery. 

In practice electrical engineers are usually going to refer to the battery or cell datasheet for the range of voltages and the (usually more important) characteristics under various discharge conditions (and charge conditions, where applicable).