View Single Post
Old 11-03-2005, 06:59 PM   #2 (permalink)
ZimbuTM
Registered User
 
Join Date: Sep 2005
Posts: 10
ZimbuTM is on a distinguished road
Ok, I did this, is it ok?

Code:
//********************************************************
//AUTHOR: Rahul Malik
//Description: Menu-driven program that tests GDate class
//Last modified: Nov. 3rd, 2005
//********************************************************

import java.util.*;

public class GDateTest02
{
	static Scanner console = new Scanner(System.in);

    public static void main(String[] args)
    {
		int userChoice;


		do
		{
			//Display menu options
			System.out.print("\n (a) Enter a date\n");
			System.out.print(" (b) Reset current date");
			System.out.print("\n (c) Print day number of current date");
			System.out.print("\n (d) Print the month name of current date");
			System.out.print("\n (e) Print number of days in current month");
			System.out.print("\n (f) Print leap year status of current year");
			System.out.print("\n (g) Print the day name of current date");
			System.out.print("\n (h) Print the current date");
			System.out.print("\n (i) Print the next day's date");
			System.out.print("\n (j) Print the previous day's date");
			System.out.print("\n (k) Compare dates");
			System.out.print("\n (l) Print calendar");
			System.out.println("\n (m) Exit program\n\n");
			System.out.print("Please make a choice: ");

			userChoice =console.nextByte();
			userChoice = (char)userChoice;


			switch (userChoice)
			{
				//(a) set a date
				case 'a': case 'A':
				System.out.print("Please enter a year, month and day (y m d): ");
				GDate date = new GDate(console.nextInt(), console.nextInt(), console.nextInt());
				break;

				//reset date to specified value
				case 'b': case 'B':


			}




		}
		while (userChoice != 'm' || userChoice != 'M');









	}

}
ZimbuTM is offline   Reply With Quote