// Programming Exam 
// Dan Wadham (1704227)

#include <stdio.h>
#include <stdlib.h>
#include <string.h>


//Question 2 - Calculating the volume of a sphere

/*
void main()
{
	
	int R, Rcubed;
	float PI = 3.142;
	float V;
	
	printf("Please input the radius: ");
	scanf_s("%d", &R);

	Rcubed = R * R * R;
	V = 4 / 3 * PI * Rcubed;
	
	printf("Sphere Volume = %.2f ^2", V);
}
*/


//Question 3 - Using arrays

/*
void main()
{
	
	int temp[5];
	int i, j, k, avg;
	float avg2;

	for (i = 0; i < 5; i++)
	{
		printf("Please input a temperature: ");
		scanf_s("%d", &temp[i]);
	}

	for (j = 0; j < 5; j++)
	{
		printf("Temperature %d is %d \n", j+1, temp[j]);
	}

	avg = temp[0] + temp[1] + temp[2] + temp[3] + temp[4];
	avg2 = avg / 5;
	printf("The average temperatures is: %.1f \n", avg2);

}
*/


//Question 4 - Using structires

/*
struct city
{
	char name[10];
	float pop;
	char country[10];
	int numparks;
};


void main()
{
	city town;
	
	strcpy(town.name, "Townville");
	town.pop = 2.4;
	strcpy(town.country, "Bigland");
	town.numparks = 26;

	city village;

	strcpy(village.name, "RiverRun");
	village.pop = 1.2;
	strcpy(village.country, "Riverland");
	village.numparks = 13;

	printf("Townville Details:\n\n");
	printf(" Name: %s \n Populaton(millions): %.1f \n Country: %s \n Number of parks: %d \n", town.name, town.pop, town.country, town.numparks);
	
	printf("\n\n");
	
	printf("RiverRun Details: \n\n");
	printf(" Name: %s \n Population(millions): %.1f \n Country: %s \n Number of parks: %d \n\n", village.name, village.pop, village.country, village.numparks);

}
*/
