Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Complete the code below public static void main(String [] args){ //The program b

ID: 3584093 • Letter: C

Question

Complete the code below

public static void main(String [] args){ //The program below takes a number N on the command line //and plots the function f(x) = sin(x*pi) on the interval [-5,5], //using N equally spaced points. //Modify this code to use the second command line //argument M and ine and plot //f(x) = sin(x*pi) + sin(3*x*pi)/3 + sin(5*x*pi)/5 //+ ... + sin((2*M-l)*x*pi)/(2*M-l), instead of sin(x). */ StdDraw.setCanvasSize(500,200); int N = Integer.parselnt(args[0]);// number of line segments to plot int M = Integer.parselnt(args[l]); StdDraw.setXscaleC-5.0, 5.0); StdDraw.setYscale(-2.0, 2.0); plotWave(N, M); } }

Explanation / Answer

ou may also try the following graph components http://www.jgraph.com/ You may also try JXGraph from SwingLab's SwingX. https://swingx.dev.java.net/ All are excellent. Hope that helps.