Ask Question

Write a program to draw a text-based graph of a mathematical function f (x)

+4
Answers (1)
  1. 13 January, 12:50
    0
    I have a very good example of the program you need written on Python. You can use this (sorry for bad tabulation):

    import math import math def main () : function = input ("Enter a function f (x) : / n") x = 0 y = 0 for rows in range (10,-11,-1) : for col in range (-10,11,1) : x=col roundfx = round (eval (function)) if roundfx = = rows: print ("o", end="") if rows==0 and col==0 and not rows = = roundfx: print ("+", end="") if col = = 0 and not rows = = 0 and not rows = = roundfx: print ("|", end="") if rows==0 and not col==0 and not rows = = roundfx: print ("-", end="") else: if not rows = = 0: if not col = = 0: if not rows = = roundfx: print (" ", end="") print () main ()
Know the Answer?
Not Sure About the Answer?
Find an answer to your question 👍 “Write a program to draw a text-based graph of a mathematical function f (x) ...” in 📗 Computers & Technology if the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers