Posts
 
Reputation
Joined
Last Seen
0 Reputation Points
Unknown Quality Score

No one has voted on any posts yet. Votes from other community members are used to determine a member's reputation amongst their peers.

0 Endorsements
~238 People Reached
Favorite Forums
Favorite Tags
java x 1
Member Avatar for patricia28

import java.util.Scanner; public class assignment8{ public static void main(String[] args ){ Scanner s = new Scanner (System.in); double a,b,c; double discriminant, r1, r2; System.out.print("Enter a, b,c"); a=s.nextDouble(); b=s.nextDouble(); c=s.nextDouble(); discriminant= Math.pow(b,2)- 4*a*c; if(discriminant>0){ r1=(-b + Math.pow(discriminant,0.5))/(2*a); r2=(-b+ Math.pow(discriminant,0.5))/(2*a); System.out.print("The equation has two roots"+ r1 + "and"+ r2+"."); }else if(discriminant==0){ r1= …

Member Avatar for ddanbe
0
238