🔒 Closed Help Python

Status
Not open for further replies.

Phc-TheCoffeeToy

Eternal Poster
This is the problem sir but ayaw mag run ng na compile ko. Patulong naman sa marurunong need ko talaga

The program will ask for a parabolas vertex and focus point. it then returns the diretrix, the length and endpoints of the latus rectum, axis of symmetry, and if it opens upward or downward.

ito yung code ko

a=float(input("Enter distance from center to vertex"))
b=float(input("Enter distance from center to co-vertex"))
c=float(input("Enter distance from center to focus"))

def parabola('a', 'b', 'c'):
print ("Vertex: (" , (-b / (2 * a)) , ", "
,(((4 * a * c) - (b * b)) / (4 * a)) , ")" )

print ("Directrix: y="
, (int)(c - ((b * b) + 1) * 4 * a ))

parabola(a, b, c)

elif parabola in ['x=2, 'y=4']:
print ("Axis of Symmetry")
elif parabola in ['upward', 'downward']:
print ("Opening")
print ("END PROGRAM")
 
Python:
def parabola(a, b, c):
    print("Vertex: (" , (-b / (2 * a)) , ", ",(((4 * a * c) - (b * b)) / (4 * a)) , ")")
    print("Directrix: y=", (int)(c - ((b * b) + 1) * 4 * a ))

a=float(input("Enter distance from center to vertex "))
b=float(input("Enter distance from center to co-vertex "))
c=float(input("Enter distance from center to focus "))

parabola(a, b, c)
 
Status
Not open for further replies.

About this Thread

  • 1
    Replies
  • 283
    Views
  • 2
    Participants
Last reply from:
zackmark29

Trending Topics

Online now

Members online
1,123
Guests online
3,912
Total visitors
5,035

Forum statistics

Threads
2,307,160
Posts
29,177,037
Members
1,193,271
Latest member
tajdmagicdaragon
Back
Top