Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm at my wits end. Everywhere I look I end up finding nothing. I'm making a program in the Free Pascal IDE that calculates the
I'm at my wits end. Everywhere I look I end up finding nothing.
I'm making a program in the Free Pascal IDE that calculates the mean, medium, and mode of 20 numbers. I managed to make something but it keeps on crashing and giving me erros. Can someone help? ~~~~~~~~~~~~~~~
uses wincrt; type larik=array [1..100] of integer; var a:larik; i,j,n:integer; Procedure input; begin write('Input Data : ');readln(n); for i:=1 to n do readln(a[i]); end; Function mean:real; var x:real; begin x:=0; for i:=1 to n do begin x:=x+a[i]; end; mean:=x/n; end; Function median:real; var b:integer; begin for i:=1 to n-1 do begin b:=0; for j:=n downto i do if a[j]0 then modus:=i; end; end; begin input; mean; median; modus; writeln('Mean : ',mean:3:2); writeln('Median : ',median:2:1); writeln('Modus : ',a[modus]); end.
~~~~~~~~~~~~~~~~~
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started