summaryrefslogtreecommitdiff
path: root/2409/CH2/EX2.10/Ex2_10.sce
diff options
context:
space:
mode:
authorpriyanka2015-06-24 15:03:17 +0530
committerpriyanka2015-06-24 15:03:17 +0530
commitb1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b (patch)
treeab291cffc65280e58ac82470ba63fbcca7805165 /2409/CH2/EX2.10/Ex2_10.sce
downloadScilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.gz
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.tar.bz2
Scilab-TBC-Uploads-b1f5c3f8d6671b4331cef1dcebdf63b7a43a3a2b.zip
initial commit / add all books
Diffstat (limited to '2409/CH2/EX2.10/Ex2_10.sce')
-rwxr-xr-x2409/CH2/EX2.10/Ex2_10.sce32
1 files changed, 32 insertions, 0 deletions
diff --git a/2409/CH2/EX2.10/Ex2_10.sce b/2409/CH2/EX2.10/Ex2_10.sce
new file mode 100755
index 000000000..a2c9861dc
--- /dev/null
+++ b/2409/CH2/EX2.10/Ex2_10.sce
@@ -0,0 +1,32 @@
+
+
+//Variable Declaration
+
+y=2000 //year
+mon=12 //month
+dy=18 //day
+hours=13 //hours of the day
+minutes=0 //Minutes of the day
+seconds=0 //Seconds of the day
+
+
+//Calculation
+d=dy+(hours/24)+(minutes/(24*60))+seconds //Days in December
+if mon<=2 then
+ y=y-1
+ mon=mon+12
+else
+ y=y
+ mon=mon
+end
+
+A=floor(y/100) //Converting years to days
+B=2-A+floor(A/4) //Converting years to days
+C=floor(365.25*y) //rounding the days
+D=floor(30.6001*(mon+1)) //Converting months to days
+JD=B+C+D+d+1720994.5 //Adding reeference to number of days
+
+
+//Result
+
+printf("The Julian day of given day is : %.4f Days",JD)