assgn4/assign4.cpp
int candidate_index(string name, string candidate[]) {
	/** Convert name provided to uppercase for
	 * case-insensitive comparison
	 */
	uppercase(name);
	
	if(name == "BUSH") {
		return 0;
	}else if(name == "KERRY") {
		return 1;
	}else if(name == "NADER") {
		return 2;
	}else if(name == "ARMSTRONG") {
		return 3;
	}else if(name == "BUCHANAN") {
		return 4;
	}else{
		// Name provided is not one of the names of the candidates
		return -1;
	}
}
/**
 * Function to determine if the name "name" of a given candidate
 * is valid
 * @param name is the name of the candidate
 * @param candidates[] is the list of candidate names
 * @return the row number of the valid name in the list;
 *	otherwise, return -1;
 */
Function to determine if the name "name" of a given candidate
is valid
@param name is the name of the candidate
@param candidates[] is the list of candidate names
@return the row number of the valid name in the list;
otherwise, return -1.
Function to determine if the name " name " of a given candidate is valid @param name is the name of the candidate @param candidates [] is the list of candidate names @return the row number of the valid name in the list ; otherwise return - 1 .
int candidate_index(string name, string candidate[]) {
	uppercase(name);
	if(name == "BUSH") {
		return 0;
	}else if(name == "KERRY") {
		return 1;
	}else if(name == "NADER") {
		return 2;
	}else if(name == "ARMSTRONG") {
		return 3;
	}else if(name == "BUCHANAN") {
		return 4;
	}else{
		return -1;
	}
}
int candidate_index ( string name , string candidate [ ] ) { uppercase ( name ) ; if ( name == " " ) { return 0 ; } else if ( name == " " ) { return 1 ; } else if ( name == " " ) { return 2 ; } else if ( name == " " ) { return 3 ; } else if ( name == " " ) { return 4 ; } else { return -1 ; } }
Function to determine if the name "name" of a given candidate
 is valid
 @param name is the name of the candidate
 @param candidates[] is the list of candidate names
 @return the row number of the valid name in the list;
      otherwise, return -1;
Function to determine if the name " name " of a given candidate is valid @param name is the name of the candidate @param candidates [] is the list of candidate names @return the row number of the valid name in the list ; otherwise return - 1 ;
/** Convert name provided to uppercase for
	 * case-insensitive comparison
	 */ // Name provided is not one of the names of the candidates