hi im a new memeber .iv started learning java recently. i was wondering could anyone help with this problem because i just cant seem to work out where i'm going wrong. its my method call thats giving me the proplem...i think. if anybody has any solutions i would be grateful

import javax.swing.*;
public class EurekaWater{
public static void main(String args[]){

String userInput,waterQty;
Double input,quantityWater, fee;

   userInput=JOptionPane.showInputDialog("enter number of home Owners");
 for(int count=0; count<input; count++)
   	waterQty=JOptionPane.showInputDialog("Enter quantity of water user in cubic feet");
   		 fee=FlatRate;   	}
   	else if (quantityWater>1000&&quantityWater<=2000){
   	else if (quantityWater>2000&&quantityWater<=3000){
   		fee=FlatPlusPlus;   	}
   	else {
   		fee=HigherRate;   	}		

  	public static double FlatRate()
   		return 15.0;
   	public static double FlatRatePlus (double units)
   		double	cost=(units-1000)*.0175+15;
   		return cost;
   	public static double FlatPlusPlus (double units)
 		double cost=((units-2000)*.02)+22.50;
   		return cost;	
   	public static double HigherRate (double units)
   	{ 	double cost;	
   		return cost=70;


Invoke Your functions as functions with ().
fee = FlatRate(); //without parameter
fee = FlatRatePlus(quantityWater); //with parameter quantityWater.

thanks you so much. that's what i did last night too but it wasn't compiling but it did it straight away this morning or some reason. thanks for that

This article has been dead for over six months. Start a new discussion instead.