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:
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
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
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
buble sort
buble sort ascending order by using Bubble sort
programm
Java BubbleSort Example
awt jdbc
awt jdbc
programm in
java to accept the details of doctor (dno,dname,salary)user & insert it into the database(use prerparedstatement class&awt
menu driven
menu driven menu driven
programm in
decimal to binary
binary to decimal
java
java diff bt core
java and
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
database connectivity problem
database connectivity problem what if client dont have database with them then what is other way to run successfully our
programm
Please visit the following link:
http://www.roseindia.net/jdbc
Java
Java how to do
java in command prompt
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