Results 1 to 3 of 3
  1. #1
    jpnym15 is offline Member
    Join Date
    Nov 2007
    Posts
    19
    Rep Power
    0

    Default I must be seriously messed up...

    ok, I tried doing this program again...seems to have everything it needs, but its still not working..help? I appreciate it so much..I know people must be getting annoyed with seeing this

    Java Code:
    import java.util.*;
    
    public class Quadratic
    { 
      public static void main(String[] args)
      {
        Scanner console = new Scanner(System.in);
    
        double a = 1, b = 1, c = 1;
      }
    
      public void numA(double a)
      {
        this.a = a;
      }
     
      public void numB(double b)
      {
        this.b = b;
      }
      
      public void numC(double c)
      {
        this.c = c;
      }
     
       public double[] getResult()
       {
         double[] result = new double[2];
         this.numA(readDouble("a"));
         System.out.println("Enter the value of a");
         scanner.nextDouble();
    
         this.numB(readDouble("b"));
         System.out.println("Enter the value of b");
         scanner.nextDouble();
    
         this.numC(readDouble("c"));
         System.out.println("Enter the value of c");
         scanner.nextDouble();
         
         result[0] = (-b+Math.sqrt((b*b)-4*a*c))/2*a);
         result[1] = (-b-Math.sqrt((b*b)-4*a*c))/2*a);
         return result;
        }
    }

  2. #2
    DarrylBurke's Avatar
    DarrylBurke is offline Forum Police
    Join Date
    Sep 2008
    Location
    Madgaon, Goa, India
    Posts
    11,419
    Rep Power
    20

    Default

    Continued from:
    I will pay

    db

  3. #3
    emceenugget is offline Senior Member
    Join Date
    Sep 2008
    Posts
    564
    Rep Power
    7

    Default

    Study a "Hello World" program to learn about your problem.

Similar Threads

  1. Non functional radio buttons and messed up array
    By flameofSuzaku in forum New To Java
    Replies: 2
    Last Post: 01-10-2011, 05:38 PM

Posting Permissions

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