Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Login         

View Questions and Answers by Category

Advertisements


 
Have Programming Question? Ask it here!
 
 
 


marios
java programm
2 Answer(s)      a year and 2 months ago
Posted in : Java Beginners


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


Advertisement
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:
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
write a programm using java
write a programm using java  print the following using java programming
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
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
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
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
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
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
java
java  diff bt core java and java
java
java  what is java
java
java  different between java & core java
java
java  explain technologies are used in java now days and structure java
java
java   why iterator in java if we for loop
Java
Java   Whether Java is pure object oriented Language
JAVA
JAVA  how the name came for java language as "JAVA
java
java  what is java reflection
 

 

 

DMCA.com