Question: (Java) need help with converting my program into dialog box instead of keyboard. the object is to calculate quadratic equation while using while loop with

 (Java) need help with converting my program into dialog box instead

of keyboard. the object is to calculate quadratic equation while using while

(Java) need help with converting my program into dialog box instead of keyboard. the object is to calculate quadratic equation while using while loop with dialog box, thanks in advance.

import java.util.Scanner; public class Main public static void main(Stringl args) int a, b, c,w; double root1, root2, d; System.out.println(Welcome to quadratic equation. Enter -999 if you don't have an equation otherwise enter some number"); Scanner s new Scanner(System.in); w-s.nextlnt0 while(w!--999) System.out.print( Enter a:"); a - s.nextlnt0; System.out.print( Enter b:"); b - s.nextlnt0; System.out.print( Enter c:"); c - s.nextlnt0: System.out.println( Given quadratic equation:"+a+ xA2+ "+b+"X+"+c); if(d > 0) System.out.println("Roots are real and unequal"); root1 - (-b + Math.sqrt(d))/(2*a); root2 -(-b - Math.sqrt(d)/(2*a); System.out.println("First root is:"+root1); System.out.println("Second root is:" +root2); else if(d - 0) System.out.println("Roots are real and equal"); root1 -(-b+Math.sqrt(d))/(2*a); System.out.println("Root:"+root1)

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!