Search:

Type: Posts; User: ryu2le

Search: Search took 0.10 seconds.

  1. Replies
    1
    Views
    2,735

    Java I/O File code; how to read/write file

    I've been reading from Lesson: Basic I/O (The Java™ Tutorials > Essential Classes) but I don't understand the jargon very well without examples.

    What I'm trying to figure out how to do is read a...
  2. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I finished the code thanks for all your help everyone.
  3. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I got the string to work. I'm having an issue with the register now. Every time I create a new register, it saves over all the variables for the previous register. Is that a problem with the...
  4. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    Is there a way to form a string from an array? I want to concatenate all the values in order from Bit[i] to Bit[bit.length]
  5. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    for this Code


    public Register(int numberOfBits, int valueStored)
    {
    Bit[] registerBit = new Bit[numberOfBits];
    for (i = 0; i < numberOfBits; i++)
    {
    registerBit[i] = new Bit();...
  6. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I tried filling the array with this code:

    public Register(int numberOfBits)
    {
    Bit[] registerBit = new Bit[numberOfBits];
    for (i = 0; i < numberOfBits; i++)
    {
    registerBit[i].reset();...
  7. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    for

    public Register(int numberOfBits)
    {
    Bit[] bit = new Bit[numberOfBits];
    }
    I'm supposed to set the array to all values of 0. I thought I did this when I did:

    public Bit()
    {
  8. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I found it. There was an extra } before this statement.
  9. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    Okay I think I fixed most of those errors. Now I have to create a Register method. What the professor wants is this:

    This method is the Register constructor. Its purpose is to construct a...
  10. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    the reset method is supposed to change the contents of the Bit object. It is supposed to change the value of the content to 0. That's why I originally though to use int object.
  11. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    My reset method is currently void. Should I change it to Bit?

    If I have a code like this

    public int reset()
    {
    return bit = 0;
    }

    then the method will return an integer. If I want it...
  12. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    okay that makes sense. So now I have this

    public static void LSR(Bit[] bit)
    {
    for (i = 0; i < bit.length; i++)
    {
    bit[i + 1] = bit[i];
    bit[0] = bit[0].reset();
    }
    }
  13. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I hate asking stupid questions but I just don't seem to understand.

    bit[0] refers to the bit[] array but isn't the bit[] array an array of the Bit object? Doesn't that mean that the bit[0] is...
  14. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I had the line
    private static Bit[] bit = new Bit[size];
    to create a Bit[] with the variable name bit with an array of Bit objects. I want to set the first bit ( bit[0] ) equal to zero, which is...
  15. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    I defined the reset() method in the class Bit() to set the value of the bit to 0.
  16. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    ----jGRASP exec: javac -g Register.java

    Register.java:11: cannot find symbol
    symbol : method reset()
    location: class Bit[]
    bit[0] = bit.reset();
    ^
    Register.java:21:...
  17. Replies
    35
    Views
    3,985

    Re: bit array and register problem

    sean4u:

    I don't really understand what the boolean data type means. Does my professor want the output to be true/false or just 0/1?

    norm:
    The register class isn't compiling at all. I'm...
  18. Replies
    35
    Views
    3,985

    bit array and register problem

    I'm having some problems with my bit class and register class for a homework assignment. Here's the first part of the question and my code for it. The code compiles but it doesn't work with the...
Results 1 to 18 of 18