java programm

Ads
 

java programm

Create program, which will calculate number of days between two dates. The program has to accordance with the leap-years (do not ignore leap-years). You must NOT use any libraries to calculate the number of days, you can use them just to verify results. Input data: The program reads one line from standard input (=argument of command line). The String format: dd.mm.yyyy-dd.mm.yyyy (d-day, m-month, y-year) Example: $java cz.vutbr.fit.ijae1.xhruba03.TestBench 10.01.0823-06.12.1983 Wrong input: If the user enters incorrect format of the input data ?? the program writes an error message to the standard output. (The program will not be interrupted!) Output data: The program writes one line to the standard output. The line contains number of days between specified dates. Example: $12354

View Answers

October 17, 2013 at 4:51 PM

HI,

Check the tutorial Date Difference.

Look for the code:

long diffDays = diff / (24 * 60 * 60 * 1000);

Though above code you can get the difference.

Thanks


October 17, 2013 at 5:18 PM

thanks but i have problem in this task i cant use libaries and i dont understand how i must do this!!!

Ads









Related Tutorials/Questions & Answers:
write a programm using java
write a programm using java  print the following using java programming
java programm
java programm  Create program, which will calculate number of days between two dates. The program has to accordance with the leap-years (do...: dd.mm.yyyy-dd.mm.yyyy (d-day, m-month, y-year) Example: $java
Advertisements
menu drive programm in java
menu drive programm in java  calculate area of circle, square,rectangele in menu driven programme in java
menu drive programm in java
menu drive programm in java  calculate area of circle, square,rectangele in menu driven programme in java
top 20 basic programm of java
top 20 basic programm of java  what is the top 20 rule to learn the basic of java.   Learn Java through the following links: http://www.roseindia.net/java/ http://www.roseindia.net/java/beginners/index.shtml
construction in java programm
construction in java programm  p*(1+r/100) at the end of year 200 p is population r is growth rate class name: population Data members : float p,r Member methods: population (int a, int b):Constructor to initialize p and r
programm
18| |84 69 54| |138 114 90|   Java Matrix
A programm for error free transmission of data using UDP in java
A programm for error free transmission of data using UDP in java  Hi... engineering college. I've got a project in java programming that should be submitted on 01.05.11, the problem is im not that good at java programming :( . Here
programm
looping programm of sum
looping programm of sum  s=1+2/12+1+2+3/12*3+1+2+3+..... n
how to write a programm in C for included code below
how to write a programm in C for included code below  Here is my question 'how to write a program in C that runs your sql-xml application session. In the session, you can run SQL queries interactively. The query results
is this programm efficient to find the day of the given date . can it be more normalized ?
is this programm efficient to find the day of the given date . can it be more normalized ?  #include <stdio.h> int main(void) { int dd,mm,yy,i,leap=0,ordi=0,odd_years,month_days= 0,total ; char week[7][10
java
java  diff bt core java and java
java
java  what is java
JAVA
JAVA  how the name came for java language as "JAVA
java
java   why iterator in java if we for loop
java
java  explain technologies are used in java now days and structure java
java
java  different between java & core java
Java
Java   Whether Java is pure object oriented Language
java
java  what is java reflection
java
java   in java does not pointers concept but what is nullpointers in java?   nullpointer is a runtime Exception
java
what is the size of array in java ?  what is the size of array in java ? what is the mean of finalize in java
java
java  Does java allows multiline comments
Java
Java  how to do java in command prompt
java
java  give a simple example for inheritance in java
java
java  give a simple example for inheritance in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  why to set classpath in java
java
java  Write a java code to print "ABABBABCABABBA

Ads