Search
 
SCRIPT & CODE EXAMPLE
 

JAVA

test a javafx project

import java.util.Scanner;  
public class QuadraticEquationExample1  
{  
public static void main(String[] Strings)   
{  
Scanner input = new Scanner(System.in);  
System.out.print("Enter the value of a: ");  
double a = input.nextDouble();  
System.out.print("Enter the value of b: ");  
double b = input.nextDouble();  
System.out.print("Enter the value of c: ");  
double c = input.nextDouble();  
double d= b * b - 4.0 * a * c;  
if (d> 0.0)   
{  
double r1 = (-b + Math.pow(d, 0.5)) / (2.0 * a);  
double r2 = (-b - Math.pow(d, 0.5)) / (2.0 * a);  
System.out.println("The roots are " + r1 + " and " + r2);  
}   
else if (d == 0.0)   
{  
double r1 = -b / (2.0 * a);  
System.out.println("The root is " + r1);  
}   
else   
{  
System.out.println("Roots are not real.");  
}  
}  
}  
Comment

PREVIOUS NEXT
Code Example
Java :: change color of drawable android studio 
Java :: java string not equal 
Java :: car class java 
Java :: boucles java 
Java :: android xml change button background 
Java :: how to use sql file in java 
Java :: java generate uuid 
Java :: replace regex group() java 
Java :: java throw keyword 
Java :: how to find length of array in java 
Java :: initialiser une arraylist 
Java :: android sha1 key 
Java :: spring filter exception handling 
Java :: java final meaning 
Java :: initialize hashmap with values 
Java :: Java How to use SortedSet? 
Java :: one line if statement java 
Java :: quicksort for arraylist 
Java :: java memory increase command 
Java :: lombok maven plugin 
Java :: nosuchelementexception 
Java :: watch service java 
Java :: convert int to byte java 
Java :: java substring based on delimiter 
Java :: java get filename without extension 
Java :: remove duplicate from string 
Java :: current time stamp android java 
Java :: print double without decimal java 
Java :: java pattern check 
Java :: how to remove a sting character in java 
ADD CONTENT
Topic
Content
Source link
Name
1+6 =