Before I start I am not asking for anyone to JUST give me the answer, but I would like help on where to go and what it means when I am told to add blank here.
My assignment this week deals with creating a date program. I have to have a user input and it must follow the correct formatting or else the program needs to inform the user that it is incorrect. Format is 02/11 (month/day) It will then convert the numbers into "February 11"
Here is what I have so far. I am stuck and could use a little push in the right direction.
import java.util.Scanner;
public class DateDriver
{
public static void main (String [] args)
{
Scanner scan = new Scanner(System.in);
Date date = new Date();
System.out.println("Enter a date in the form mm/dd ('q' to quit): ");
String quit = scan.next();
if (quit.equals("q") || quit.equals("Q"))
{
//
}
else
{
System.out.println("");
}
}
}
public class Date
{
int month;
int day;
public Date(int month, int day)
{
month = month;
day = day;
}
public int getMonth()
{
return month;
}
public int getDay()
{
return day;
}
}
Thanks for all the help in advanace. I would like to stress that I want to do the work I just do not understand exactly what I am doing.
This post has been edited by macosxnerd101: 20 September 2011 - 01:12 PM
Reason for edit:: Renamed title to be more descriptive

New Topic/Question
Reply



MultiQuote








|