Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 2 of 2

Thread: How do I do I calculate the difference between two entered days of the week in java

  1. #1
    Junior Member
    Join Date
    Mar 2014
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How do I do I calculate the difference between two entered days of the week in java

    I need to create a simple Java program that calculates the difference between two entered days of the week with the following requirements: • Ask the user to enter in a day of the week by name (e.g. Monday)
    • Ask the user to enter in another day of the week by name (e.g. Friday)
    • Create a static method other than main that takes in two Strings as input, and returns an integer value equal to the difference between the two days
    • Use an array with the days of the week in it to find each entered in day of the week, and use their indices to calculate the difference
    • Output the difference for the user to see


  2. #2
    Member
    Join Date
    Oct 2013
    Location
    Manila, Philippines
    Posts
    285
    My Mood
    Amused
    Thanks
    6
    Thanked 64 Times in 61 Posts

    Default Re: How do I do I calculate the difference between two entered days of the week in java

    So what have you tried now?
    Is there something wrong with your code?
    If you have code paste it here and ask specific questions like "why it prints exception", or "why the output is wrong".

Similar Threads

  1. My first week learning Java!
    By SelfTaught in forum What's Wrong With My Code?
    Replies: 3
    Last Post: September 12th, 2013, 01:47 AM
  2. 2nd week with Java. Help with a few basic syntax errors?
    By D P in forum What's Wrong With My Code?
    Replies: 7
    Last Post: January 28th, 2012, 11:13 PM
  3. Replies: 1
    Last Post: December 4th, 2010, 05:26 PM
  4. Calculating Business days in java
    By narranil2 in forum Algorithms & Recursion
    Replies: 2
    Last Post: August 17th, 2010, 12:08 PM
  5. Check difference between no. of stops, calculate cost
    By JavaStudent23 in forum Java Theory & Questions
    Replies: 4
    Last Post: November 17th, 2009, 03:29 AM