a. Complete the following program.
% This program reads a set of responses to a survey in which there
% are five possible answers: A - E. The program then writes a summary
% giving the number of times that each response was made. The program
% assumes that all data are valid and that a dollar sign will be the
% last value entered.
const FIRST_CHOICE := 'A'
const LAST_CHOICE := 'E'
var total : array FIRST_CHOICE .. LAST_CHOICE of int
var response : char
% Initialize array for counting responses.
.
.
.
% Read responses and increment corresponding array location to count
%the frequency of each response.
.
.
.
% Write summary of responses.
.
.
b. Show the output that would be produced by your program given the following
input:
ECCBBBEAAEDCACBBEAEDBBC$
Save program as Survey_yourName.t
|