We use nested if .. else statements to solve the different choises we have for the solution of the Quadratic equation.
The program is split into modules (called methods in Java).
*MODULARITY - ADVANTAGES (reference to computational thinking)
*(INSERT METHOD - CALCULATE METHOD - OUPUT METHOD)
*1. MODULARITY ADDS TO THE READABILITY OF THE PROGRAM
*2. EASIER TO TEST AND DEBUG
*3. CODE REUSE - YOU CAN CALL THE SAME METHOD FROM DIFFERENT PARTS OF THE PROGRAM
*4. DIFFERENT PARTS OF THE PROGRAM CAN BE DEVELOPPED FROM DIFFERENT PROGRAMERS AT THE SAME TIME - OFCOURSE
* THEY MUST AGREE BETWEEN THEM INTO SOME CONVENTIONS LIKE SIZE OF THE MODULES, NAMES OF THE VARIABLES ETC
*5. THE PROGRAM IS EASIER TO MAINTAIN AND UPGRADE
Try to find an algorithmic solution to the equation at the end of the program. You may wish to consult the books in the library or your prof in Maths.
The program is split into modules (called methods in Java).
*MODULARITY - ADVANTAGES (reference to computational thinking)
*(INSERT METHOD - CALCULATE METHOD - OUPUT METHOD)
*1. MODULARITY ADDS TO THE READABILITY OF THE PROGRAM
*2. EASIER TO TEST AND DEBUG
*3. CODE REUSE - YOU CAN CALL THE SAME METHOD FROM DIFFERENT PARTS OF THE PROGRAM
*4. DIFFERENT PARTS OF THE PROGRAM CAN BE DEVELOPPED FROM DIFFERENT PROGRAMERS AT THE SAME TIME - OFCOURSE
* THEY MUST AGREE BETWEEN THEM INTO SOME CONVENTIONS LIKE SIZE OF THE MODULES, NAMES OF THE VARIABLES ETC
*5. THE PROGRAM IS EASIER TO MAINTAIN AND UPGRADE
Try to find an algorithmic solution to the equation at the end of the program. You may wish to consult the books in the library or your prof in Maths.