Write a C program to which inputs the response for each student and which computes / outputs the required percentages. Assume that 25 students were surveyed.
This
campus, the percentage who drive to campus and the percentage who live in residence on campus.
The results of the survey are recorded as follows:
W
D
D
L
.
.
.
This data is to be interpreted as follows: the first person surveyed said that he walks – hence W is
recorded, the second person said that he drives – hence D, the third person said that he drives –
hence D, and the fourth person said that he lives on campus – hence L.
Write a C program to which inputs the response for each student and which computes / outputs the
required percentages. Assume that 25 students were surveyed.
Your prompt should have the following format:
Do you walk, drive or live on campus. Use
W – if you walk
D – if you drive
L – if you live on campus
Use the following data for the execution of your program:
W D D L L W D D L L W W D D W L W L L D W L W L D
Step by step
Solved in 3 steps with 1 images