Difference between revisions of "Quadratic Formula Assignment"
From WLCS
Line 2: | Line 2: | ||
# Create a program, where you prompt the user (ask the user for input) for variables a, b, and c | # Create a program, where you prompt the user (ask the user for input) for variables a, b, and c | ||
− | # Calculate both real solutions | + | # Calculate both real solutions using the quadratic formula |
## Reminder: There are two roots to calculate | ## Reminder: There are two roots to calculate | ||
## HINT: exponentiation: x**y (x to the y power) | ## HINT: exponentiation: x**y (x to the y power) | ||
## HINT2: square root is the same as taking something to the power 0.5 | ## HINT2: square root is the same as taking something to the power 0.5 | ||
# Print the quadratic equation: a*x^2 + b*x + c = c | # Print the quadratic equation: a*x^2 + b*x + c = c | ||
− | # Print the two real solutions | + | # Print the two real solutions of the quadratic formula |
# CHALLENGE: check if the solutions are real or imaginary | # CHALLENGE: check if the solutions are real or imaginary | ||
# CHALLENGE2: print both solutions even if imaginary | # CHALLENGE2: print both solutions even if imaginary |
Revision as of 09:01, 7 October 2008
Objective: We will create a program that calculates the quadratic formula given user input
- Create a program, where you prompt the user (ask the user for input) for variables a, b, and c
- Calculate both real solutions using the quadratic formula
- Reminder: There are two roots to calculate
- HINT: exponentiation: x**y (x to the y power)
- HINT2: square root is the same as taking something to the power 0.5
- Print the quadratic equation: a*x^2 + b*x + c = c
- Print the two real solutions of the quadratic formula
- CHALLENGE: check if the solutions are real or imaginary
- CHALLENGE2: print both solutions even if imaginary