English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

Display a list of points (x,y) for the values of x from -2 to 2 in integer increments for the graph y=x^2-3x-2

2007-06-26 16:07:59 · 1 answers · asked by nobody 1 in Computers & Internet Programming & Design

1 answers

class MyClass {
public static void main(String[] args) {
for (int x=-2; x<=2; ++x) {
System.out.println("(" + x + "," +
(x*x - 3*x - 2) + ")");
}
}
}

==================
Output:

(-2,8)
(-1,2)
(0,-2)
(1,-4)
(2,-4)

2007-06-26 16:18:42 · answer #1 · answered by McFate 7 · 0 0

fedest.com, questions and answers