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 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!!!









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
error at the oracle programm with jsp - JSP-Servlet
error at the oracle programm with jsp  an error occured at myodbc:jdbc:missig comma
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
could not find the main class programm will exit - error
could not find the main class programm will exit - error  when i tried to run the below mentioned programmed it gives a error states - could not find main class programm will exit. class Car { String name: String Color
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
Binary Search - Java Beginners
Binary Search  how to use Binary think in java give me the Binary Search programm thx
java - Java Beginners
java  i have to make a programm in java to multiply any number with 100 without using any math operator.  To multiply with 100 no need of mathematical operators. int result=Integer.parseInt(String.valueOf(num)+"00
What is reflection? - Java Beginners
in Java. Thanks   Hello, Through reflection you can do activity at runtime or examine the exceutting java programm. ex= through bello programm you can get all the list of method of MyClass same like this you can get
java - Java Beginners
, Structure of Java programm [package declarations] [import statements] [class... Java has its own method to write a program. Write the structure of a Java program..."); } } Compiling the program C:\>javac Hello.java Run java program
java - Java Beginners
java  i have to make a programm in java to multiply any number with 100 without using any math operator.I hav got this answer. but i hav to make it without using +,*,/,- etc. here + is used in this. Answers To multiply
Extending thread - Java Beginners
Extending thread  what is a thread & give me the programm of exeucte the thread   Hi friend, Thread : A thread is a lightweight... visit to : http://www.roseindia.net/java/thread/index.shtml Thanks
Send me Binary Search - Java Beginners
Send me Binary Search  how to use Binary think in java give me the Binary Search programm thx..  Hi friend, import java.io....)); } } ----------------------------------------- Read for more information. http://www.roseindia.net/java/ Thanks
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
compilation error - Java Beginners
: C:\>javac -d . Group.java 3)For execute the programm : C:\>java... not executing the java file currectly, 1- put the Employee.java file in c
java program - Java Beginners
java program  plzzzzz help me on this java programming question? hello people.. can u plzzzzzzzzzzzzzzzzzzz help me out with this java programm. its... **** 4. Enter your move: q n *** Invalid source. Please retry **** 4. Enter
JSF Search - Java Server Faces Questions
JSF Search  Hi, Do you have any examples of how to do a Search programm using JSF in RAD.My Search button should carry the value of the input text field as a parameter and should search in the database for the parameter
Need help in java programming
Need help in java programming  Hello. Can someone please help me with writig the following programm. Assignment 20% Presentation 10% Mini Test 10% Exam 60% Java program that accepts the following details: student
menu driven
menu driven   menu driven programm in decimal to binary binary to decimal
how to color the Eclipse editor background programmatically?
how to color the Eclipse editor background programmatically?  I have to color specific portion(background) of the of the Eclipse editor by running the java programm and provided that do the coloring from a given line number
que - Struts
que  how can i run a simple strut programm? please explain with a proper example. reply soon.  Hi Friend, Please visit the following link: http://www.roseindia.net/struts/ Thanks
Hibernate code
Hibernate code  programm 4 hibernate  Hi, Read hibernate tutorial at http://www.roseindia.net/hibernate/ Thanks   please read at the the link http://www.roseindia.net/hibernate
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
how can you calculate you your age in daies??
how can you calculate you your age in daies??  **hi, I am beginner in java! can any one help me to write programm to calculate age in daies???**   Hi Friend,ADS_TO_REPLACE_1 Try the following code: import
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  is java open source
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  give a simple example for inheritance in java
java
java  why to set classpath in java
java
java  Does java allows multiline comments
java
java  what are JAVA applications development tools
Java
Java   Whether Java is Programming Language or it is SOftware
java
java  explain object oriented concept in java

Ads