Ask Question
6 May, 02:57

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

+5
Answers (1)
  1. 6 May, 06:24
    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 and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers