Clank
Last Activity:
Feb 2, 2013
Joined:
Apr 21, 2009
Messages:
987
Likes Received:
0
Trophy Points:
0

Following 3

Followers 3

Birthday:
Jul 24, 1987 (Age: 36)
Location:
6316 km away from Sydney

Share This Page

Clank

CL Ank, 36, from 6316 km away from Sydney

Clank was last seen:
Feb 2, 2013
    1. Fungus
      Fungus
      Yeah I am. It's due next week sometime. :(
    2. Fungus
      Fungus
      Yeah, I just finished them...

      But I'm sick of the assignment. I really don't know what classes I need or where to start. Java seems so hard to me lol.
    3. Fungus
      Fungus
      Noooooooooooooo!

      Got to do this project. Haven't really done much else as I had mid semester for exams. And have another assignment after that. Also have a mid semester to do it after this for OOP.
    4. Flack
      Flack
      Clank->Fail(true); //:ninja:
    5. Flack
      Flack
      Public var in a class? You fail :ninja:
    6. Flack
      Flack
      int main () {
      cout << "**** you" < endl;
      }
    7. Flack
      Flack
      MOGUMOGUMOGUMOGU
    8. Fungus
      Fungus
      Hmm, I copied your code over, and it's working. :confused:

      Oh well. Thanks. Might need to ask you more stuff later. :p
    9. Fungus
      Fungus
      Hmm got it working with this:

      import java.util.Scanner;

      public class Task1
      {
      private Scanner keyboard = new Scanner(System.in);

      public static void main(String[] args) { new Task1().programStart(); }

      public void programStart()
      {
      for ( int i = 0; i < 2; i++ )
      {
      ask(1);
      }
      }

      public void ask(int num)
      {
      System.out.print("Hello, what is your name? ";);
      String name = keyboard.nextLine();
      System.out.print("And how old are you? ";);
      int age = keyboard.nextInt();
      keyboard.nextLine(); // read the whole line, not just the int
      System.out.println("Hi, " + name + ". You are " + age + " years old.";);
      }
      }

      So I wouldn't need to do ask(2)?
    10. Fungus
      Fungus
      Well, that's what's happening, so I'm not sure. :confused:
    11. Fungus
      Fungus
      I thought we don't need the ( int i = 0; i < 2; i++ ) bit when we are using the ask(1) and ask(2)? :confused:
    12. Fungus
      Fungus
      I mean it's an infinite loop. It was suppose to run through that thing two times - ie creating two new ID.
    13. Fungus
      Fungus
      That makes it keep going lol. Hmm, too late anyway. Lost 1 mark lol.

      But still interested in how to get it working.
    14. Fungus
      Fungus
      I wanted to do it using the ask(1), ask(2), but I'm not sure how to code it in the method?
    15. Fungus
      Fungus
      {
      ask(1);
      ask(2);
      }
      }
      public void ask()

      Would that also work somehow? Sorry about all the questions.
    16. Fungus
      Fungus
      Hmm, did you really have to define NUM_TIMES = 2? Couldn't you just use for ( int i = 0; i < 2; i++ )
      ?
    17. Fungus
      Fungus
      Yes, already. How do I refact this?



      import java.util.Scanner;

      public class Task1
      {
      private Scanner keyboard = new Scanner(System.in);

      public static void main(String[] args) { new Task1().programStart(); }

      public void programStart()
      {
      System.out.print("Hello, what is your name? ";);
      String name1 = keyboard.nextLine();
      System.out.print("And how old are you? ";);
      int age1 = keyboard.nextInt();
      keyboard.nextLine(); // read the whole line, not just the int
      System.out.println("Hi, " + name1 + ". You are " + age1 + " years old.";);

      System.out.print("Hello, what is your name? ";);
      String name2 = keyboard.nextLine();
      System.out.print("And how old are you? ";);
      int age2 = keyboard.nextInt();
      keyboard.nextLine(); // read the whole line, not just the int
      System.out.println("Hi, " + name2 + ". You are " + age2 + " years old.";);
      }
      }
    18. Fungus
      Fungus
      Ank to help me with refactors. :p
    19. Fungus
      Fungus
      Posting in Pumas subbie.
    20. Fungus
      Fungus
      Na, it's a really really simple program using Java. The ghosts don't actually move... :p
  • Loading...
  • Loading...
  • About

    Birthday:
    Jul 24, 1987 (Age: 36)
    Location:
    6316 km away from Sydney
    SC Batting:
    192 Runs @ 3.00
    FC Bowling:
    Yet to bowl
    SC Bowling:
    68 Wickets @ 44.00
    OD Batting:
    Yet to bat
    OD Bowling:
    Yet to bowl
    OD2 Batting:
    1 Runs @ 1.00
    OD2 Bowling:
    8 Wickets @ 18.63
    Batting Rank:
    N/A
    Bowling Rank:
    156th
    RLSim:
    122
    RUSim Posts:
    0
    Allrounder Ranking:
    N/A