Difference between revisions of "Quadratic Formula Assignment"

From WLCS
Line 1: Line 1:
'''Objective:''' We will create a program that calculates the quadratic formula given user input
+
'''Objective:'''  
 +
* You will create a program that calculates the quadratic formula from given user input
  
 +
'''Directions:'''
 
# 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 using the quadratic formula (look it up on the internets)
 
# Calculate both real solutions using the quadratic formula (look it up on the internets)

Revision as of 08:30, 9 October 2009

Objective:

  • You will create a program that calculates the quadratic formula from given user input

Directions:

  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 using the quadratic formula (look it up on the internets)
    1. Reminder: There are two roots to calculate
    2. HINT: exponentiation: x**y (x to the y power)
    3. HINT2: square root is the same as taking something to the power 0.5
  3. Print the quadratic equation: a*x^2 + b*x + c = 0
  4. Print the two real solutions of the quadratic formula


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