summaryrefslogtreecommitdiff
path: root/1316/CH1/EX1.18
diff options
context:
space:
mode:
Diffstat (limited to '1316/CH1/EX1.18')
-rw-r--r--1316/CH1/EX1.18/example1_18.sce20
-rw-r--r--1316/CH1/EX1.18/resultexample1_18.txt2
2 files changed, 22 insertions, 0 deletions
diff --git a/1316/CH1/EX1.18/example1_18.sce b/1316/CH1/EX1.18/example1_18.sce
new file mode 100644
index 000000000..da47b38df
--- /dev/null
+++ b/1316/CH1/EX1.18/example1_18.sce
@@ -0,0 +1,20 @@
+//Chapter 1
+//Example 1.18
+//Page 42
+
+clear;
+clc;
+
+t1=21.2;
+t2=25;
+t3=18.5;
+t4=22.1;
+t5=19.7;
+t6=27.1;
+t7=19;
+t8=20;
+AVE=(t1+t2+t3+t4+t5+t6+t7+t8)/8;
+
+//Finding the arithmetic mean of the temperature
+printf("The arithmetic mean of the temperatue is %f degree celcius \n",AVE);
+printf("The standard deviation is %.2f degree celcius",sqrt(((t1-AVE)^2)+((t2-AVE)^2)+((t3-AVE)^2)+((t4-AVE)^2)+((t5-AVE)^2)+((t6-AVE)^2)+((t7-AVE)^2)+((t8-AVE)^2))/sqrt(8-1));
diff --git a/1316/CH1/EX1.18/resultexample1_18.txt b/1316/CH1/EX1.18/resultexample1_18.txt
new file mode 100644
index 000000000..a25086f90
--- /dev/null
+++ b/1316/CH1/EX1.18/resultexample1_18.txt
@@ -0,0 +1,2 @@
+The arithmetic mean of the temperatue is 21.575000 degree celcius
+The standard deviation is 3.04 degree celcius \ No newline at end of file