Giter Site home page Giter Site logo

Comments (12)

TFloyd1989 avatar TFloyd1989 commented on May 31, 2024 1

I wasn't too sure how to implement it, I'm planning on coming to office hours today at 2:30 to discuss it in more detail as well

from dsa-java.

lujiaying avatar lujiaying commented on May 31, 2024

Could you provide the code snippet to make the question more clear?
I can hardly reproduce the error with limited information provided.

from dsa-java.

TFloyd1989 avatar TFloyd1989 commented on May 31, 2024

Screenshot (6)
Screenshot (5)
Screenshot (4)
Screenshot (2)

from dsa-java.

TFloyd1989 avatar TFloyd1989 commented on May 31, 2024

Included are both versions of the addDifferentsign, as well as the error message when I try to run add. I have also included a screenshot of the longintegerquiztest errors.

from dsa-java.

lujiaying avatar lujiaying commented on May 31, 2024

@TFloyd1989 thanks for the screenshots.

From the first screenshot, error in L28 could be due to:

LongInteger a = new LongInteger("123");  //change LongIntegerQuiz to LongInteger

Please pay more attention to these kinds of errors caused by typos. And try to fix all similar typos.

I also encourage you to read carefully about the error logs. I believe some bugs can be fixed by yourself after reading them.

from dsa-java.

TFloyd1989 avatar TFloyd1989 commented on May 31, 2024

Thank you, however, that was the state of the file after I downloaded it from the textbook. Specifically, it said LongIntegerQuiz rather than longinteger.
Screenshot (7)

from dsa-java.

lujiaying avatar lujiaying commented on May 31, 2024

@TFloyd1989 Sorry. I have not went through the quiz1. So my previous response was indeed wrong. Please give me some time to figure out myself and then reach back to you.

Thanks.

from dsa-java.

TFloyd1989 avatar TFloyd1989 commented on May 31, 2024

Oh okay, no problem and thank you for the help!

from dsa-java.

lujiaying avatar lujiaying commented on May 31, 2024

From the first screenshot, error in L28 could be due to:

The constructor function that specifically has one input String argument is not implemented for LongIntegerQuiz.

We can mimic (not copy; also please try the super() trick) the constructor function in LongInteger.java to implement our own constructor function.

   /**
     * Creates a long integer by copying the specific object.
     * @param n the object to be copied.
     */
    public LongInteger(LongInteger n) {
        super(n.sign);
        digits = Arrays.copyOf(n.digits, n.digits.length);
    }

    /**
     * Creates a long integer with the specific sign and values.
     * @param n the sign and values to be set.
     * @see #set(String)
     */
    public LongInteger(String n) {
        set(n);
    }

from dsa-java.

lujiaying avatar lujiaying commented on May 31, 2024

@TFloyd1989 does it solve the issue?

from dsa-java.

TFloyd1989 avatar TFloyd1989 commented on May 31, 2024

My code appears to match the one above word for word now that I'm looking at it

from dsa-java.

jdchoi77 avatar jdchoi77 commented on May 31, 2024

@TFloyd1989 as we talked about this over the office hour, please let me know if it becomes the issue after you create constructors for LongIntegerQuiz. Thanks.

from dsa-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.