|
Learning objectives:After completing this project, you should be able to:
Items in red are learning objectives for this part of the project. |
Group work
| SelectionAndIteration report
| Time limit
|
SelectionAndIteration
. SelectionAndIterationReport.txt
, placing it in the docs
subfolder of your SelectionAndIteration
project. SelectionAndIterationReport.txt
file. You will use it to record your answers to the questions in all of the parts of this exercise. Start the report with an appropriate title, your names, the date, and a heading to indicate the beginning of Part 1.SelectionAndIteration
project, calling the module SelectionAndIteration
, spelled just like that. SelectionAndIteration
project to your new CVS module. JOptionPane
for all required input and output (I/O) in this project (you are free to use whatever method you prefer for other I/O)..a = 1, b = -4 , c = 3
a = 1, b = -4 , c = 4
a = 1, b = -4 , c = 8
if
statement that displays the message The roots are complex conjugates
when the discriminant is negative. The syntax for an if
statement is:
if( condition 1 ) { statement block 1 }
if
statement. else
part to your if
statement that displays the message The root(s) are real
when the discriminant is non-negative. The syntax for an if-then-else
statement is:
if( condition 1 ) { statement block 1 } else { statement block 2 }
else
part in this case as opposed to a second if
statement. There is a single repeated root
when the discriminant is zero, and There are two distinct real roots
when the discriminant is positive. if
statement." Explain why it should be indented like this:
if( condition 1 ) { statement block 1 } else if( condition 2 ) statement block 2 } else { statement block 3 }
SelectionAndIteration1
.if
statements.