Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 quadratics
Index -> Programming, Turing -> Turing Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Viper




PostPosted: Thu Sep 08, 2005 8:41 am   Post subject: quadratics

The formula for finding the roots of a quadratic equation (learned in gr. 11&12 math) is: if the equation is given in the form ax2 + bx + c = 0.
If the actual roots are not desired, but only the NUMBER of real solutions there are, the value under the square root sign must be determined first. If this value is negative there are no roots. If this value is 0 there is one root as determined by the formula. If the value is positive, there are two roots.
i need an algorithm which accepts the values of a, b, and c as input, calculates the value of the discriminant D = b2 - 4ac and reports the number of roots.
Sponsor
Sponsor
Sponsor
sponsor
StarGateSG-1




PostPosted: Thu Sep 08, 2005 11:01 am   Post subject: (No subject)

ummmm...

USE VARIABLES Very Happy

Formula in programing work just like a calulator!
Display posts from previous:   
   Index -> Programming, Turing -> Turing Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 2 Posts ]
Jump to:   


Style:  
Search: