Reference no: EM131141706
Design a class named MyDate. The class contains :
• The data fields year, month, and day that represesents a date. month is 0-based, i.e., 0 is January.
• A no-arg constructor that creates a MyDate object for the current date.
• A constructor that constructs a MyDate object with a specified elapsed time since midnight, January 1, 1970, in milliseconds.
• A constructor that constructs a MyDate object with the specified year, month, and day.
• Three get and set methods for the data fields year, month and day respectively. Write a test program that creates two MyDate objects (using new MyDate() and new MyDate( 3435555533101L) and displays their year, month and day. Hint : you can use any pre-defined class like GregorianCalendar to simplify coding:
• Java API has the GregorianCalender class in the java.util package, which you can use to obtain year, month and day of a date.
• The no-arg constructor constructs an instance of the current date and the methods get(GregorianCalendar.YEAR), get(GregorianCalendar.MONTH), and get(GregorainCalendar.Day_OF_MONTH) return the year, month and day.
• The GregorianCalendar class has setTimeInMillis(long), which can be used to set a specified time since January 1, 1970.
Determine an alternative to arraylists using strings
: I am attempting to determine an alternative to ArrayLists using strings and arrays. Additionally, one of the conditions of the assignment is that I have to support using a file (perhaps a comma delimited text file) to populate the vending machine..
|
Write down a detailed description of the problem
: Using the simplified OOD methodology: Write down a detailed description of the problem. Identify all the (relevant) nouns and verbs
|
Write a java program to accept a day number from the user
: Write a Java program to accept a day number from the user and display the corresponding day name by using the if/else construct
|
Computes the raise and new salary for an employee
: Computes the raise and new salary for an employee. Complete the following program to determine the raise and new salary for an employee by adding if ... else statements to compute the raise
|
Design a class named mydate
: Design a class named MyDate. The class contains: The data fields year, month, and day that represesents a date. month is 0-based, i.e., 0 is January. A no-arg constructor that creates a MyDate object for the current date
|
Calculate the additional amount of sales
: The application will now compare the total annual compensation of at least two salespersons. It will calculate the additional amount of sales that each salesperson must achieve to match or exceed the higher of the two earners
|
Calculate the kilometers
: Write a program called MilesToKilometers that converts miles to kilometers. Read the miles value from t he user as a double point value. Calculate the kilometers
|