Challenge: Graph two functions :) | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

Challenge: Graph two functions :)

Write a program (in any language you like) that graphs two functions in a single Cartesian coordinate system. Requirements: (1) Your program should make a call to a function that contains the expression to be graphed. (2) The user must change the expression inside the function before pressing <Run>. (3) The user must input the following values in order: (lower bound for values of x), (upper bound for values of x) and (the value by which x-values will increment). (4) The y-axis should be horizontal, and the x-axis should be vertical. As a motivation, the program below (which I wrote in C++) graphs one function. https://code.sololearn.com/c2MvIO3BBnBh/#cpp TIP: Two-dimensional arrays might prove useful here. :) Good luck :)

10th Aug 2017, 1:35 AM
Jaydee Lucero
Jaydee Lucero - avatar
2 Answers
+ 2
I haven't implemented variable bounds yet but have some of the framework in place. Everything else is good input m and c on 1 line (accepts -ve decimal and fraction values) https://code.sololearn.com/ci43Jy1TGOoo/?ref=app
7th Oct 2017, 10:11 AM
Ben-Davis
Ben-Davis - avatar
0
https://code.sololearn.com/WEfflJx3Sus8/?ref=app
12th Aug 2017, 10:42 PM
Falcon ψ
Falcon ψ - avatar