summaryrefslogtreecommitdiff
path: root/1553/CH19/EX19.4/19Ex4.sce
diff options
context:
space:
mode:
Diffstat (limited to '1553/CH19/EX19.4/19Ex4.sce')
-rw-r--r--1553/CH19/EX19.4/19Ex4.sce16
1 files changed, 16 insertions, 0 deletions
diff --git a/1553/CH19/EX19.4/19Ex4.sce b/1553/CH19/EX19.4/19Ex4.sce
new file mode 100644
index 000000000..f693a36bc
--- /dev/null
+++ b/1553/CH19/EX19.4/19Ex4.sce
@@ -0,0 +1,16 @@
+//chapter 19 Ex 4
+
+clc;
+clear;
+close;
+
+sCycle=12; sBoat=10; sRiver=4;
+sAvgCyclist=12; //since the speed of cyclist is same in both directions
+sDown=sBoat+sRiver;
+sUp=sBoat-sRiver;
+sAvgSailor=(2*sDown*sUp)/(sDown+sUp);
+if(sAvgCyclist>sAvgSailor)
+ {printf("The cyclist will return to place A first");}
+
+else{printf("The sailor will return to place A first");}
+ end