Answer:
The algorithm:
Input days
sum = 0
for i = 1 to
input text
sum = sum + text
end for
average = sum/days
print average
The program in pascal:
var days, sum, text, i:integer;
var average : real;
Begin
write ('Days: '); readln(days);
sum:=0;
for i := 1 to do
write ('Text: '); readln(text);
sum:=sum+text;
end;
average := (sum/days);
writeln ('The average text is' , average);
End.
Explanation:
This declares all variables
var days, sum, text, i:integer;
var average : real;
This begins the program
Begin
This gets the number of days from the user
write ('Days: '); readln(days);
Initialize sum to 0
sum:=0;
This iterates through the days
for i := 1 to do begin
This gets the text for each day
write ('Text: '); readln(text);
This sums up the texts
sum:=sum+text;
End loop
end;
Calculate average
average := (sum/days);
Print average
writeln ('The average text is' , average);
End program
End.
Answer:
Computer science is the study of problems, problem-solving, and the solutions that come out of the problem-solving process. Given a problem, a computer scientist's goal is to develop an algorithm, a step-by-step list of instructions for solving any instance of the problem that might arise. ... Algorithms are solutions.
Explanation:
#CarryOnLearning
Trend micro security for your Mac or pc or trend micro mobil security for your android or iOS Mobil device?
Hope this helps!