<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def check_type_declaration(parameter_names, parameter_types):
 """Checks that exactly the given parameter names have declared types. :param parameter_names: The names of the parameters in the method declaration :type parameter_names: list[str] :param parameter_types: Parameter type by name :type parameter_types: dict[str, type] """

    if len(parameter_names) != len(parameter_types):
        raise Exception("Number of method parameters ({}) does not match number of "
                        "declared types ({})"
                        .format(len(parameter_names), len(parameter_types)))
    for parameter_name in parameter_names:
        if parameter_name not in parameter_types:
            raise Exception("Parameter '{}' does not have a declared type".format(parameter_name))