Computer Science Canada

Turing "Survey" need help

Author:  IAmJoopis [ Tue Jan 19, 2016 2:12 pm ]
Post subject:  Turing "Survey" need help

I need some help with this problem, I don't know how to solve it...

code:
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
[/b]

Author:  Insectoid [ Tue Jan 19, 2016 3:05 pm ]
Post subject:  RE:Turing "Survey" need help

Have you tried anything yet?


: