Results 1 to 5 of 5
  1. #1
    JRStClair2010 is offline Member
    Join Date
    Mar 2012
    Posts
    1
    Rep Power
    0

    Default New to Java and need help! Please!

    I have an assignment that I am completely blown away by...if anyone could help guide me along it would be much appreciated.

    Implement a class QuadraticEquation whose constructor receives the coefficients a, b, c of the quadratic equation ax2 + bx +c = 0. Supply methods getSolution1 and getSolution2 that get the solutions, using the quadratic formula. Write a test class QuadraticEquationTester that constructs a QuadraticEquation object, and prints the two solutions.

  2. #2
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: New to Java and need help! Please!

    The quadratic equation is (-b +- sqrt(b^2 - 4ac)) / 2a. From here it should be simple.

  3. #3
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: New to Java and need help! Please!

    Quote Originally Posted by sunde887 View Post
    (-b +- sqrt(b^2 - 4ac)) / 2a


    (-b ± √(bČ - 4ac)) / 2a

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

  4. #4
    sunde887's Avatar
    sunde887 is offline Moderator
    Join Date
    Jan 2011
    Location
    Richmond, Virginia
    Posts
    3,069
    Blog Entries
    3
    Rep Power
    8

    Default Re: New to Java and need help! Please!

    Quote Originally Posted by DarrylBurke View Post


    (-b ± √(bČ - 4ac)) / 2a

    db

    Ooh! Fancy formatting!

  5. #5
    DarrylBurke's Avatar
    DarrylBurke is online now Member
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,237
    Rep Power
    19

    Default Re: New to Java and need help! Please!

    Quote Originally Posted by sunde887 View Post
    Ooh! Fancy formatting!
    No, unicode.

    db
    If you're forever cleaning cobwebs, it's time to get rid of the spiders.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •