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

java work

Name: Anonymous 2007-10-04 13:27

import java.util.*;
public class HailStorm{
  public static void main(String[] args){
    Scanner scan = new Scanner(System.in);
    System.out.println("Enter a start number ( Must be an integer )");
    int hail = scan.nextInt();
    do {
    if (hail % 2 == 0) 
    hail = (hail/2);
    System.out.println(hail);
    else hail = ((hail*3)+1)
    System.out.println(hail);
    }while (hail<= 1);
  }
}

ok guis im getting some bullshit errors and im new to this crap so some real help would be sweet. Any and all suggestions would be helpful.

in b4 tl;dr and become an hero

"7 errors found:
File: C:\homework\cs121\HailStorm.java  [line: 11]
Error: C:\homework\cs121\HailStorm.java:11: 'else' without 'if'
File: C:\homework\cs121\HailStorm.java  [line: 11]
Error: C:\homework\cs121\HailStorm.java:11: <identifier> expected
File: C:\homework\cs121\HailStorm.java  [line: 11]
Error: C:\homework\cs121\HailStorm.java:11: ';' expected
File: C:\homework\cs121\HailStorm.java  [line: 12]
Error: C:\homework\cs121\HailStorm.java:12: <identifier> expected
File: C:\homework\cs121\HailStorm.java  [line: 12]
Error: C:\homework\cs121\HailStorm.java:12: <identifier> expected
File: C:\homework\cs121\HailStorm.java  [line: 13]
Error: C:\homework\cs121\HailStorm.java:13: class, interface, or enum expected
File: C:\homework\cs121\HailStorm.java  [line: 14]
Error: C:\homework\cs121\HailStorm.java:14: class, interface, or enum expected
"

Name: Anonymous 2007-10-04 13:34

You best be trolling nigger.

Name: Anonymous 2007-10-04 13:37

See kids, this is why FORCED INDENTATION is a Good Thing.

Name: Anonymous 2007-10-04 13:55

Even SICP wouldn't work on someone this dense.

Name: Anonymous 2007-10-04 14:28

>>4
SICP IS CONFUSING

Name: Anonymous 2007-10-04 14:47

>>5
Only if you are an idiot. Keep in mind that I just put a pencil in my ear to free my hands to type this post.

Name: Anonymous 2007-10-04 14:55

try this:

import java.util.*;
public class HailStorm
  public static void main(String[] args)
    Scanner scan = new Scanner(System.in);
    System.out.println("Enter a start number ( Must be an integer )");
    int hail = scan.nextInt();
    do
    if (hail % 2 == 0) 
    hail = (hail/2);
    System.out.println(hail);
    else hail = ((hail*3)+1)
    System.out.println(hail);
    while (hail<= 1);

Name: Anonymous 2007-10-04 14:56

>>6
WHAT'S A COMPUTER

Name: Anonymous 2007-10-04 16:31

public class HailStorm{
  public static void main(String[] args){
    java.util.Scanner scan = new java.util.Scanner(System.in);
    System.out.println("Enter a start number ( Must be an integer )");
    int hail = scan.nextInt();
    do{                                // Fuck you
        if(hail%2==0){
            hail=(hail/2);
            System.out.println(hail);}
        else(hail=((hail*3)+1))
            System.out.println(hail);
    }while (hail<=1);
  }
}

Name: Anonymous 2007-10-04 16:32

else if(hail==((hail*3)+1))

Whoops.

Name: Anonymous 2007-10-04 16:36

>>1
CS students asking for halp on programs mentally challenged five year olds could write. Pathetic.

Name: Anonymous 2007-10-04 16:45

`HailStorm'? More like `FailStorm' amirite?

Name: Anonymous 2007-10-04 16:48

Alternatively, ShitStorm

Name: Anonymous 2007-10-04 16:58

>>12
>>13
Yes, very much so. The truck of phail has collided with the truck of shit. Nasty mess it is.

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