Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Can some one help me with this? JAVA

Name: Anonymous 2013-04-17 22:18

Im trying to get this program to calculate rainfall but I screwed up the loop and Im not sure how to get it too work.
import java.util.Scanner;


public class RainDemo {
    public static void main(String[]args)
    {
        Scanner keyboard = new Scanner(System.in);
        double years;
        double use=1;
        double rainfall;
        double raintotal=0;
        double months;
        double RA; //RA Rain average
        double YT; //YT is year total
        double YC; //YC is short for year counter
        System.out.println("User 4/17/2013\n");
        System.out.print("Enter the number of years: ");
        years=keyboard.nextDouble();
        if (years<=0)
        {
            System.out.print("Invalid. Enter 1 or greater: ");
            years=keyboard.nextDouble();
           
        }
        raintotal=1;
        months=1;
        YC=1;
        YT=years*12;
       
        System.out.println("Enter the rainfall, in inches, for each month.");
        //System.out.print(""); Backup line
        for(YC=0;YC==years;YC++)
       
           
            for(months=1;months>=12;months++)
            {
                System.out.print("Year "+YC +" month " +months);
                rainfall=keyboard.nextDouble();
                if (raintotal>=0)
                {
                    System.out.print("Invalid. Enter 1 or greater: ");
                rainfall=keyboard.nextDouble();
                }
                raintotal=raintotal+rainfall;
            }
       
       
        System.out.println("Number of months: "+YT);
        RA=raintotal/YT;
        System.out.println("Total Rainfall: "+raintotal+" Inches.");
       
        System.out.println("Average monthly rainfall: "+RA+" Inches");
    }
}

Name: Anonymous 2013-04-17 22:23

Name: Anonymous 2013-04-17 23:10

in


for(A; B; C) {
  D_1;
  D_2;
  ...
  D_n;
}


The loop will execute while B is true.

Name: Anonymous 2013-04-18 18:41



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-18 18:46



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Name: Anonymous 2013-04-18 18:52



Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop


Searching for legit Microsoft Product keys, Windows 8,7,Studio,Server etc.?

 Mail me at jeremiahgoldstein@hotmail.com

 25$ a pop

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List