This program will output the graph of y = x 2. Ask the user for at least 4 integer
inputs for the x-coordinate. The inputted x-coordinate values are to be stored in
an array named xCoord.
Write a user-defined function that will compute the value of the y-coordinate
given the x-coordinate value. The computed y-coordinate values are to be stored
in an array named yCoord.
Function prototype: int computeSquare(int x);
Your program will then plot each of the coordinates. (If you do not wish to graph,
then simply output a table of values in an organized manner.)
So I'm trying to get the user to input 4 coordinates, I figured that, so now to get the y-coordinates I made it
yCoord = xCoord * xCoord to create an array of the four numbers entered in the xCoord array, then I tried yCoord = (xCoord)^2, no go...
The result I get:
1 2 3 4
1245052
Why does it come out like this? Heres the code.
inputs for the x-coordinate. The inputted x-coordinate values are to be stored in
an array named xCoord.
Write a user-defined function that will compute the value of the y-coordinate
given the x-coordinate value. The computed y-coordinate values are to be stored
in an array named yCoord.
Function prototype: int computeSquare(int x);
Your program will then plot each of the coordinates. (If you do not wish to graph,
then simply output a table of values in an organized manner.)
So I'm trying to get the user to input 4 coordinates, I figured that, so now to get the y-coordinates I made it
yCoord = xCoord * xCoord to create an array of the four numbers entered in the xCoord array, then I tried yCoord = (xCoord)^2, no go...
The result I get:
1 2 3 4
1245052
Why does it come out like this? Heres the code.
