This performs statistical analysis on a dataset of numbers provided int the text file. It calculates the average, median, variance, and standard deviation of the numbers and prints out the results
- Go Programming Language installed on your system.
Run these commands on your terminal window to clone the repository and install the program
git clone https://learn.zone01kisumu.ke/git/aadero/math-skills.git
cd math-skills
To use this program, follow these stesps:
- Place your dataset in a text file (data.txt) each number is on a separate line. For example:
189
113
121
114
145
110
...
-
Use the terminal (command line) to navigate the folder whre you Go prgram and data file is located.
-
Run your program with the following command, replacing
data.txt
with the path to your data file:
go run . data.txt
Make sure you replace data.txt
with the actual filename of the data set if it's different.
The program will output the calculations as rounded integers in the terminal:
Average: 35
Median: 4
Variance:5
Standard Deviation: 65
Note: The Numbers shown above are only an example. Your results will vary depending on the data contained in your file.
- Ensure tha you're in the correct directory where your Go Program exists.
-Double-check that
data.txt
exists in the same directory and is corectly formarted with numbers, one per line. - If you encounter permission issues, make sure the Go program file is executable. You may set this with
chmod +x your-program.go
on Unix systems.
mvuvi - Zone01 Kisumu Aspiring developer.
I would like to Thank Zone01 and Cohort-1 peers that helped me learn and inspired me to create this program.