Question: Hello! so this is java language. i am working on gui java program. this program solves quadratic equations. what i have so far works but

Hello! so this is java language. i am working on gui java program. this program solves quadratic equations. what i have so far works but not for imageinary numbers. so i want to add codes which will solve imaginary numbers.

example will be if A=1, B=2, C=3. then solution is with imaginary number(giveing in the screenshot). this is what i have so far and solution for imaginary numbers need to looks like it is in the screenshot. (1+2, 12)

Thanks.

Hello! so this is java language. i am working on gui java

import javax.swing.*; import java.awt.*; import java.awt.event.*; import java.text.DecimalFormat;

class QuadraticFrame extends JFrame

{ private JLabel lblTitle; private JLabel lblFirst; private JLabel lblSecond; private JLabel lblThird; private JTextField txtFirst; private JTextField txtSecond; private JTextField txtThird; private JTextField txtAnswer1; private JTextField txtAnswer2; private JButton btnSolve; private JButton btnClear; private final int WINDOW_WIDTH = 700; private final int WINDOW_HEIGHT = 700; private Font font = new Font("Serif", Font.BOLD, 30);

public QuadraticFrame() { setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE); setTitle("Find the roots"); buildPanels(); setSize(WINDOW_WIDTH, WINDOW_HEIGHT); setVisible(true); } private void addComponentsAndSetFont() { JComponent components[] = { lblTitle, lblFirst, lblSecond, lblThird, txtFirst, txtSecond, txtThird, txtAnswer1, txtAnswer2, btnSolve, btnClear }; for(int i=0; i

}

public class QuadraticApp { public static void main (String args[]) { new QuadraticFrame(); } }

x 2+2x +3-0 or Choose Topic E AVAILABLE METHODS Quadratic Formula Complete the Square 1 In general, given az bae c 0, there 4ac -b 2a 2a 2 In this case, a 1, b 2 and c 3 2 22 4 x 3 -2 22-4X3 3 Simplify 4 Simplify solutions 1 2,-1- 2 Done

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!