#include <stdio.h>

int main(void) {
// **************************************************
	// Function: irishLicensePlateValidator
	//
	// Description: Validates an Irish License Plate
	// for the years between 2013 and 2024
	//
	// Parameters: year - two digit year (13 - 24)
	//	       halfYear - when car sold (1st half / 2nd half of year)
	//		   county - must be from C/c, D/d, G/g, L/l, T/t, or W/w
	//		   SSSSSS - a 1 to 6 digit sequence number
	//
	// Returns:    1 or 0 for true or false (whether it is valid)
	//
	// ***************************************************	
	int irishLicensePlateValidator(int year, int halfYear, char county, int SSSSSS)
	{
	
	    // you can get most all values you need from the parameter values passed in
	
		int valid = 1; // 0 or 1 variable returned at the end
	    // add some conditional statement logic to check each parameter (switches, if/else, ...)
	
		// checks whether year is outside the range of 2013-2024
		if((year < 13) || (year > 24))
		{
			valid = 0; 
		}
		
		// checks whether halfYear is incorrect (must be 1 or 2)
		if((halfYear != 1) && (halfYear != 2))
		{	
			valid = 0; 
		}
		
		// checks if the county is valid
		switch(county)
		{
			case 'c': // Cork
				break; 
			case 'C': 
				break; 
			case 'd': // Dublin
				break; 
			case 'D': 
				break; 
			case 'g': // Galway
				break; 
			case 'G': 
				break; 
			case 'l': // Limerick
				break; 
			case 'L': 
				break; 
			case 't': // Tiperary
				break; 
			case 'T': 
				break; 
			case 'w': // Waterford
				break; 
			case 'W': 
				break; 
			default: // if it is none of the cases, invalid
				valid = 0; 
		}
		
		// checks if the sequence number is between 1 to 6 digits
		if ((SSSSSS < 1) || (SSSSSS > 999999))
		{
			valid = 0; 
		}
		
		return(valid); 
	}
	
	printf("Supposed to be true: %d", irishLicensePlateValidator(13, 1, 'D', 21));
	printf("\nSupposed to be false: %d", irishLicensePlateValidator(12, 1, 'D', 21));
	printf("\nSupposed to be false: %d", irishLicensePlateValidator(13, 3, 'D', 21));
	printf("\nSupposed to be false: %d", irishLicensePlateValidator(13, 1, 'K', 21)); 
	printf("\nSupposed to be false: %d", irishLicensePlateValidator(13, 1, 'D', 1245891));

	return 0;
}
