私が取り組んでいるこの Ada プログラムをコンパイルしようとすると、なぜ未定義のエラーが発生するのか完全に困惑しています。私はそれを何度も見直しました... スペルミスやその性質のものはありません。これが私が持っているもので、続いて私が得ているエラーがあります。
Get_Score(CandidateVotes, CurrentCandidate);
end loop;
end Get_Input;
procedure Get_Score(CandVotes: in CurrentCandidate_Votes;
Candidate: in Character) is
-- get the score for the candidate and store it into CandidatesArray
SameAnswers: Integer;
DifferentAnswers: Integer;
CandidateScore: Integer;
begin
for I in VoterArray_Index loop
if Voter(I) /= 0 And CandVotes(I) /= 0 Then
if Voter(I) /= CandVotes(I) Then
DifferentAnswers := DifferentAnswers + 1;
else
SameAnswers := SameAnswers + 1;
end if;
end if;
end loop;
CandidateScore := SameAnswers - DifferentAnswers;
Candidates(Candidate) := CandidateScore;
end Get_Score;
コード ブロックの上部は、別のプロシージャから Get_Score プロシージャを呼び出している場所です。CandidateVotes と CurrentCandidate のタイプは正しいです。もっと投稿する必要がある場合は、お知らせください。
また、エラーには次のように表示されます。