Algorithm roots of quadratic formula what cases do

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

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: line bx+c=0 root at c/b) a=0,b=0 (horizontal line, no roots unless c =0) a=0,b=0,c=0 (infinite roots) Algorithm: Roots of Quadratic Formula Pseudocode write "Enter the coefficients of the formula:" read a,b,c if a,b,and c equal 0 write "infinite roots" exit if a and b equal 0 write "no roots" exit if a equals 0 root = c/b write "One root at x=", root exit . . . Testing Remember once you've translated your pseudocode into actual code that you need to test every possible case...
View Full Document

Ask a homework question - tutors are online