You are on page 1of 1

UNIVERSITY OF DAR ES SALAAM CoET

DEPARTMENT OF CHEMICAL AND PROCESS ENGINEERING


CP260: Computer Applications in Chemical Engineering Assignment 2

A quadratic equation is expressed as


ax 2 + bx + c = 0
Solution of quadratic equations is obtained using a well-known formula:
− b  b 2 − 4ac
x1, 2 =
2a
Depending on the coefficients, quadratic equations can give one or a combination of the following
solutions:
(i) no roots,
(ii) single root,
(iii) real roots, and
(iv) complex roots.

a) What are the analytical solutions of the following equations?


1. x2 + 2x + 1 = 0
2. 3x 2 + 4 x + 5 = 0
3. 2x2 + 6x + 3 = 0
4. x 2 + 3x − 2 = 0
5. 0x2+7x-6=0

b) Assuming you have several (more than 3) quadratic equations to be solved:


(i) Develop a flowchart for the solution process
(ii) Write a Fortran program, based on the flowchart, that will yield the roots of each of the
quadratic equations you have. Make sure this is done by just one execution process (i.e.
single run). The results should be displayed on the screen as well as being written in a
file that can be retrieved later.
(iii)What results does your program give for the equations in (a) above?

Submit your solution (including the Program) in MS-Word by 10th May 2021,
16:00 hours

You might also like