//------------------------------------------------------------------------------
// Author:      Jeremiah "wazzzaaa" Bullfrog
// Student No.: 12345678         
// Assessment:  Assignment 2
// Purpose:     To create and test a number of functions to estimate speeds and 
//              times of files being transferred over a network.

//------------------------------------------------------------------------------
// Included Libraries
#include <stdio.h>

//------------------------------------------------------------------------------ 
// Constants relating to network simulation
const int BITS_IN_A_BYTE = 8; // Number of bits in a byte
const int BYTES_IN_A_KILOBYTE = 1024; // Number of bytes in a KiloByte 
const int TEST_FILE_SIZE_1 = 44; // Kilobytes for my fish image on door 
const int TEST_FILE_SIZE_2 = 300; // Kilobytes for average document 
const int TEST_FILE_SIZE_3 = 4000; // Kilobytes for average song 
const double TEST_TIME_1 = 10.0; // Seconds for transfer test 
const double MY_SPEED = 24000000.0; // bits per sec for my connection

//------------------------------------------------------------------------------ 
//Function Prototypes

//------------------------------------------------------------------------------ 
int convertKiloBytesToBits(int xkiloBytes);
//------------------------------------------------------------------------------ 
// Purpose:   To take a number of KiloBytes as an integer and calculate how many 
//	      bits there are in the file
// Ret.Val:   The number of bits in a given number of Kilobytes
// Pre:
// Post:

//------------------------------------------------------------------------------ 
double getTransferRate(int fileSizeInBits, double timeInSeconds);
//------------------------------------------------------------------------------ 
// Purpose:   To calculate the average number of bits that can be transferred 
//	      along the connection in a second.
// Ret.Val:   The average number of bits transferred in a second
// Pre:
// Post:

//------------------------------------------------------------------------------ 
double getTimeEstimate(int fileSizeInBits, double transferRate);
//------------------------------------------------------------------------------ 
// Purpose:   To take the average transfer rate and divide it by the size of the
//            file.
// Ret.Val:   The estimated amount of time it will take to complete the transfer
// Pre:
// Post:

//------------------------------------------------------------------------------
int main() {
//------------------------------------------------------------------------------
	int result=0;
	result=convertKiloBytesToBits(TEST_FILE_SIZE_1);
	printf("file 1 has %d bits\n", result);

	return 0;
}

//------------------------------------------------------------------------------
// Functions
//------------------------------------------------------------------------------

int convertKiloBytesToBits(int xkiloBytes) {

	//Multiply the number of Kilobytes by 1024 to determine the number of 
	//bytes, and then multiply the result by 8 to determine the number of bits
	
	return xkiloBytes * BYTES_IN_A_KILOBYTE * BITS_IN_A_BYTE;

}
