#include "library.h" const int maxx = 600, maxy = 600; bool drawn = false; double f1(const double x) { return 300 + 200*sin(x/100) + 50*cos(x/20); } double f2(const double x) { return 300 + 100*sin(x/50) + 100*cos(x/40); } void tabulate(const double x, const double finalx, double f(const double x)) { if (x <= finalx) { print("When X is "); print(x); print(", Y is "); const double y = f(x); print(y); new_line(); if (drawn) draw_to(x, maxy-y); else move_to(x, maxy-y); drawn = true; tabulate(x+1, finalx, f); } } void main() { make_window(maxx, maxy); set_pen_width(3); set_pen_color(color::blue); tabulate(0, maxx, f1); set_pen_color(color::red); drawn = false; tabulate(0, maxx, f2); }