By the end of this task, you will be able to identify conditions and implement
conditional logic with confidence. You’ll learn how to interpret and analyze flowcharts
that use decision blocks, allowing you to predict outcomes based on different inputs.
Additionally, you’ll develop the debugging skills to help ensure that the logic in your
programs or spreadsheets accurately reflects the decisions you intend to make.
In programming, you will often need your program to make decisions based on the
conditions it is given. You can tell your programs when to make decisions by writing
conditional statements into your program or spreadsheet. Conditional statements check
if a condition is either True or False and then perform actions based on the outcome.
In flowcharts, we represent conditional logic with diamond shaped decision blocks.
One team member should open the answer sheet ex3_team_1_teamnumber.docx, and
save it with your team number replacing teamnumber in the file name. Working as
a team, add your solutions for each part below to the document.
Your team has been tasked with designing a program that determines the nature of the
root(s) of a quadratic function of the form \(f(x) = ax^2 + bx + c\). The three
possible outcomes depend on the value of the discriminant (\(b^2 - 4ac\)), and are
summarized in Table 3.6. Create a flowchart for
your program that takes \(a\), \(b\), and \(c\) as inputs, and uses decision
blocks based on the value of the discriminant to determine the nature of the function’s
roots.
The roots of a quadratic equation of the form \(ax^2 + bx + c = 0\), where
\(a\), \(b\) and \(c\) are real numbers, can be found using the quadratic
formula:
\[x = \frac{{-b \pm \sqrt{{b^2 - 4ac}}}}{{2a}}\]
The term \(b^2 - 4ac\), is known as the discriminant and can be used to determine
the nature of the roots of the quadratic equation.