I have plenty fg wil pay for good help thanks
ill take any help I can get and pm if u can do it all lol
This is a programming in C class
This is my assignment
Description:
Create a C program that reads in a stream of integer pairs,
each representing an (x,y) pair in the cartesian coordinate
system. For each successive pair of integers, display the
distance and direction traveled from one pair to the next.
You can assume that in each successive pair only one value
changes, so that travel is always right, left, up, or down.
{This would be like the locations displayed in the tracker.c
example from the "Conditional Statements" section in
Polzin's online notes (the x, y values.) }
Also, keep a running total of the distance between each pair
of points and determine the distance between the
initial/starting point and the final/finish point.
This is what I got so far.
#include <stdio.h>
#include <stdlib.h>
int main ()
{
int x, y;
int b=2;
int a;
printf(" How many different Coordinates: ");
scanf("%d",&a);
int array[a][b];
for(y = 0; y <= a-1; y++)
{
printf("Enter points: ");
for(x = 0; x <= b-1; x++)
scanf("%d", &array[x][y]);
}
printf("\n");
for(x = 0; x <= b-1; x++)
{
for(y = 0; y <= a-1; y++)
printf("[%d][%d]=%2d ", x, y, array[x][y]); //Just to show what the array is holding.
printf("\n");
}
So basically I have the array but now how do I use the array to calculate the distance between points and keep a running total??