Search:

Type: Posts; User: Grot

Search: Search took 0.13 seconds.

  1. Replies
    5
    Views
    201

    Re: Java Inheritance problem

    I was expecting 12000000
  2. Replies
    5
    Views
    201

    Re: Java Inheritance problem

    fixed the [code=java] part
  3. Replies
    5
    Views
    201

    Java Inheritance problem

    Hey guys I'm a bit stuck here with my inheritance



    package Lab3;

    public class Building {
    /* {author=John Roche sb12218, version=1.1}*/

    // Attributes : Instance variables
  4. Replies
    7
    Views
    221

    Re: Linked List question

    The question is

    -Write a class that represents a person. A person should have a name and an age.
    -Write a Java program that implements a linked list using the LinkedList class:

    -The program...
  5. Replies
    7
    Views
    221

    Re: Linked List question

    What I have done is it correct?
  6. Replies
    7
    Views
    221

    Re: Linked List question

    My problem is I have create five people objects with different names and ages and
    add them to the LinkedList using the add(e) method. The program should then print out the names and ages of each...
  7. Replies
    7
    Views
    221

    Linked List question

    Hey Guys I'm really stuck on a question here what I'm supposed to do is

    Write a class that represents a person. A person should have a name and an age.
    Write a Java program that implements a...
  8. Replies
    6
    Views
    290

    Re: Card shuffle program

    Thanks a lot Norm!

    --- Update ---

    Yes it work you're a legend!!!
  9. Replies
    6
    Views
    290

    Re: Card shuffle program

    Ok I got it working when I replace 52 with 104

    My output is

    7 of diamonds in black
    4 of diamonds in red
    Jack of spades in black
    9 of hearts in black
    Jack of hearts in red
  10. Replies
    6
    Views
    290

    Re: Card shuffle program

    My problem is I'm not sure where to fix this
  11. Replies
    6
    Views
    290

    Card shuffle program

    Hello I'm getting an error in my code here
    what I'm trying to do is output a shuffle of 5 cards e.g 4 of diamonds in red



    package javacards;

    import java.util.Random;

    public class Deck {
  12. Replies
    5
    Views
    327

    Re: for-each loop and a switch statement

    What I'm trying to figure out is how do I loop through the enum with the switch statement and output it through the for loop
  13. Replies
    5
    Views
    327

    for-each loop and a switch statement

    Hey I'm trying to Write a class called MonthTest.java that uses the enum Month and outputs the
    following:
    January has 30 days.
    February has 28 days.
    March 31 days.

    December 31 days.

    I'm...
  14. Re: Telling the user they left their input blank **GUI**

    The .showMessageDialog doesn't seem to appear, The code look correct yes?

    Grot
  15. Telling the user they left their input blank **GUI**

    Can anybody help me what I'm doing wrong here?

    Grot


    private void convertDtoEActionPerformed(java.awt.event.ActionEvent evt) {
    double sol...
  16. Replies
    9
    Views
    235

    Re: Can someone please explain this code for me?

    ok thanks Norm.
  17. Replies
    9
    Views
    235

    Re: Can someone please explain this code for me?

    What does the String myS = myField.getText(); do?
  18. Replies
    9
    Views
    235

    Re: Can someone please explain this code for me?

    I think “” is supposed to be "".

    From when I see in this code is that
    if a key 'a' is pressed something happens
    and it creates a space.

    Am I right?
  19. Replies
    9
    Views
    235

    Re: Can someone please explain this code for me?

    I got this code from a book but it didn't explain it, I edited it there so you can see it better
    Thanks for the help Norm! you're a legend!
  20. Replies
    9
    Views
    235

    Can someone please explain this code for me?

    @Override
    public void keyPressed(KeyEvent e)
    {
    if (e.getKeyChar() == 'a' ){
    String myS = myField.getText();
    myLabel.setText(myS);
    myLabel2.setText(“”);
    }
    }
  21. Re: Generating random numbers between 999999 - 1000000 with an alpha number at the end

    Ok thanks Norm
  22. Re: Generating random numbers between 999999 - 1000000 with an alpha number at the end

    The numbers are stored in a txt file e.g
    Random PPS Number : 1911462N
    Random PPS Number : 2714102K
    Random PPS Number : 5070317E
    Random PPS Number : 8030837K
    Random PPS Number : 4358369S
  23. Re: Generating random numbers between 999999 - 1000000 with an alpha number at the end

    I edited it there for you thanks

    Grot

    --- Update ---



    import java.io.FileNotFoundException;
    import java.io.PrintWriter;
  24. Generating random numbers between 999999 - 1000000 with an alpha number at the end

    Hey every I'm stuck with trying to generate 1000 random numbers that have 7 digits my code is here below
    I don't know how to set it to a fix digit number, I know it's simple but it's doing my head...
Results 1 to 24 of 24