Difference between revisions of "Quadratic Formula Assignment"

From WLCS
(New page: === Quadratic Formula Program === # Create a program, where you prompt the user (ask the user for input) for variables a, b, and c # Calculate both real solutions to the quadratic equatio...)
 
Line 1: Line 1:
=== Quadratic Formula Program ===
+
'''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  
 
# Create a program, where you prompt the user (ask the user for input) for variables a, b, and c  
 
# Calculate both real solutions to the quadratic equation
 
# Calculate both real solutions to the quadratic equation
 
# Print the quadratic equation: a*x^2 + b*x + c
 
# Print the quadratic equation: a*x^2 + b*x + c
 
# Print the two real solutions
 
# Print the two real solutions
# HINT: exponentiation: x**y (x to the y power)
+
 
 +
 
 +
HINT: exponentiation: x**y (x to the y power)
 +
 
  
 
# 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 08:43, 7 October 2008

Objective: We will create a program that calculates the quadratic formula given user input

  1. Create a program, where you prompt the user (ask the user for input) for variables a, b, and c
  2. Calculate both real solutions to the quadratic equation
  3. Print the quadratic equation: a*x^2 + b*x + c
  4. Print the two real solutions


HINT: exponentiation: x**y (x to the y power)


  1. CHALLENGE: check if the solutions are real or imaginary
  2. CHALLENGE2: print both solutions even if imaginary