PA 2 - negative, the equation has no real roots. Write a...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
COP 3502: PROGRAMMING ASSIGNMENT 2 DUE DATE: FEB 3, 4:00 PM “NOTE: You need to submit only .java files through Sakai.” The two roots of a quadratic equations ax 2 + bx + c = 0 can be obtained using the following formula. ± ² ³´ µ √´ ³ ·¸¹ ¶¸ ² ³´ ³ √´ ³ ·¸¹ ¶¸ b 2 -4ac is called the discriminant of the quadratic equation. If it is positive, the equation had two real roots. If it is zero, the equation has one root. If it is
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: negative, the equation has no real roots. Write a program that prompts the user to enter the values for a, b and c and displays the result based on the discriminant. Describe in your own how you solved the problem, including the input, output, and computations. Note: you can use Math.pow(x,0.5) to compute . (20 points)...
View Full Document

This note was uploaded on 02/15/2012 for the course COP 3502 taught by Professor Staff during the Spring '12 term at University of Florida.

Ask a homework question - tutors are online