// Cost For Shipment
// January 30th 2010
// Created By Nic Raboy

/*
  * DESCRIPTION:  This program will let the user determine how much it costs to ship a set of parcels based on their weight.
  * The costs for weights are not accurate towards your postal service, they are just made up numbers so don't think that they are
  * real.  First you will be prompted to enter how many parcels you want to ship.  Then you will enter the weight for each of the parcels.
  * When done a price will be calculated for you.
 */

#include <stdio.h>
#include <stdlib.h>

int main()
{
	int count;
	int i;
	float total = 0;
	printf("How many parcels are there?> ");
	scanf("%d", &count);	// Have user input an integer value to represent parcel count
	float parcel[count];	 // Allocate an array that has the total size in respect to the number of parcels there are
	for(i = 0; i < count; i++)
	{
		printf("Weight of parcel #%d?> ", i+1);	// Ask for the weight of the current parcel
		scanf("%f", &parcel[i]);	// Have user input float values to represent weights
	}
	for(i = 0; i < count; i++)
	{
		if(parcel[i] < 2.5)
		{
			total = total + 3.5;
		}
		if(parcel[i] >= 2.5 && parcel[i] <= 5)
		{
			total = total + 2.85;
		}
		if(parcel[i] > 5)
		{
			total = total + 2.45;
		}
	}
	printf("Total Cost> %f\n", total);
	return 0;
}