I seem to have done something wrong, but I can't figure out with it is. Everytime I compile I get the error "reached end of file while parsing"
. Can anyone help me find where this error is?
public class ElectricBill
{
private double k;
private boolean s;
public ElectricBill(double pKwh, boolean pSummer)
{
k = pKwh;
s = pSummer;
}
public double getUsage()
{
return k;
}
public boolean isSummerRate()
{
return s;
}
private double calcSummerCost()
{
double sumCost = 5 + 0.0825*k + 0.0169*k;
return sumCost;
}
private double calcWinterCost()
{
if ( k <= 400)
{
return 5 + 0.0760*k + 0.0169*k;
}
if ( (k >400) && (k < 1000))
{
return 5 + 0.0760*400 + 0.0637*(k-400) + 0.0169*k;
}
if ( k > 1000)
{
return 5 + 0.0760*400 + 0.0637*(400+600) + 0.0604*(k-(400+600)) + 0.0169*k;
}
}
public double getTotal()
{
if (s)
{
return calcSummerCost();
{
if (!s)
{
return calcWinterCost();
}
}
}