#include &quot;basic.h&quot;

int NumberOfBodies;

struct object{
	double mass;
	double radialdistance;
	double polarangle;
	double azimuthalangle;
	double xcoordinate;
	double ycoordinate;
	double zcoordinate;
	};

struct object * objectarray = NULL;
	
struct object object;

int i=0;

int input(){
	printf(&quot;Insert number of bodies in the System:&quot;);
	scanf(&quot;%d&quot;,&amp;NumberOfBodies);

	objectarray = calloc(NumberOfBodies, sizeof(struct object));

	if (objectarray == NULL) {
	fprintf(stderr, &quot;No more memory can be allocated \n Hope you like eels! \n&quot;);				
}

    for (i=0; i&lt;NumberOfBodies; i++){
		printf(&quot;For Body number %d \n&quot;,i);
		
		printf(&quot;Enter mass of body (kg) %d : \n&quot;,i);
		scanf(&quot;%lf&quot; , &amp;object.mass);
		
		printf(&quot;Enter the, |r|, the radial distance of object %d: \n&quot;, i);
		scanf(&quot;%lf&quot; , &amp;object.radialdistance);
		
		printf(&quot;Enter the polar angle, theta, of object %d: \n&quot;, i);
		scanf(&quot;%lf&quot; , &amp;object.polarangle);
		
		printf(&quot;Enter the azimuthal angle, thi, of object %d: \n&quot;, i);
		scanf(&quot;%lf&quot; , &amp;object.azimuthalangle);
		
		printf(&quot;Converting the coordinates you entered in to Cartesian&quot;);
		
		conversion();

		objectarray[i] = object;
	}

	return(0);
}

int conversion(){
		
		object.xcoordinate =  (&amp;object.radialdistance)*cos(&amp;object.azimuthalangle)*sin(&amp;object.polarangle);
		
		object.ycoordinate = (&amp;object.radialdistance)*sin(&amp;object.azimuthalangle)*sin(&amp;object.polarangle);
		
		object.zcoordinate = (&amp;object.radialdistance)*cos(&amp;object.polarangle);
	
	return(0);
}