Results 1 to 3 of 3
- 10-14-2010, 11:46 AM #1
Member
- Join Date
- Oct 2010
- Posts
- 1
- Rep Power
- 0
quadratic equation, problems that i can't solve
here are the errors:Java Code:import java.io.*; import javax.swing.JOptionPane; class RownanieKwadratowe { //static float a, b, c, delta; //static String pomocniczy; //static double x, x1, x2; public static void main(String[] args) { float a, b, c; String pomocniczy; double x, x1, x2, delta; pomocniczy=JOptionPane.showInputDialog(null, "Podaj wspolczynnik a równania kwadratowego: "); a=Float.parseFloat(pomocniczy); pomocniczy=JOptionPane.showInputDialog(null, "Podaj wspolczynnik b równania kwadratowego: "); b=Float.parseFloat(pomocniczy); pomocniczy=JOptionPane.showInputDialog(null, "Podaj wspolczynnik c równania kwadratowego: "); c=Float.parseFloat(pomocniczy); if (a!=0) { delta=(b*b)-(4*a*c); if (delta<0) System.out.println("Delta mniejsza od 0. Brak pierwiastkow rzeczywistych."); if (delta==0) { x=(-b)/(2*a); System.out.println("Jeden pierwiastek podwojny x=" + x); } if (delta>0) { x1= (-b - Math.sqrt(delta))/2*a; x2 =(-b + Math.sqrt(delta))/2*a; System.out.println("Dwa pierwiastki rzeczywiste x1="+ x1 + " x2="+ x2); } } else System.out.println("To nie rownanie kwadratowe. Nie mozna liczyc pierwiastkow."); System.exit(0); } }
1. Description Resource Path Location Type
Syntax error on token "0", delete this token Zadanie2.java /Zadanie2/src line 47 Java Problem
2. Description Resource Path Location Type
Syntax error on token "Invalid Character", invalid AssignmentOperator Zadanie2.java /Zadanie2/src line 40 Java Problem
3. Description Resource Path Location Type
Syntax error on token(s), misplaced construct(s) Zadanie2.java /Zadanie2/src line 47 Java Problem
4. Description Resource Path Location Type
The left-hand side of an assignment must be a variable Zadanie2.java /Zadanie2/src line 40 Java Problem
i don't know extacly what i did do wrong :/ can you help me? I'm new in java...that's my first program here...Last edited by kourai; 10-14-2010 at 11:49 AM.
- 10-14-2010, 12:59 PM #2
- Join Date
- Jul 2007
- Location
- Colombo, Sri Lanka
- Posts
- 11,374
- Blog Entries
- 1
- Rep Power
- 18
For the first one, can you post what's there in line 47. I'm lazy to run the code and see.
- 10-14-2010, 01:31 PM #3
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,405
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
quadratic equation whith Rational class
By adamrain in forum New To JavaReplies: 8Last Post: 12-22-2009, 05:35 PM -
please I need your help to solve these problems
By edge_5050@hotmail.com in forum New To JavaReplies: 2Last Post: 12-17-2008, 08:34 PM -
Quadratic Equation
By jpnym15 in forum New To JavaReplies: 4Last Post: 11-12-2008, 03:29 AM -
Please help me solve these Java Problems
By saculellav in forum New To JavaReplies: 7Last Post: 07-27-2008, 11:58 AM -
Help with quadratic equation in java
By paul in forum New To JavaReplies: 1Last Post: 07-25-2007, 08:23 PM


LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks