The code must take into account

Assignment Help JAVA Programming
Reference no: EM13167016

You will create a Java class named Date that is used to work with date operations. Then you will write a Driver to test each method you wrote in the Dare class and display, on the screen, a clear explanation and result of each test.

For documentation, use inline comments AND javadoc comments above each class and above each method. Use the tags : @author, @version, @param, @return

Mandatory methods for the Date class:

- At least three constructor methods, including the default constructor and the copy constructor.

- A toString( ) method.

- An equals( ) method.

- A compareTo( ) method.

- an add( ) method that adds an integer number of days to an existing Date and returns the new Date object:

Date myDate = new Date(3, 20, 2014);

Date result;

result = Date.add(15);

System.out.println(result);

- A subtract( ) method that subtracts an integer number of days from an exisiting Date and returns a new Date object.

Date myDate = new Date(3, 20, 2014);

Date result;

result = myDate.subtract(5);

System.out.println(result);

A dateDiff( ) methods that calculates and returns the number of days between the parameters and the Date object.

Date dateOne = new Date(3,15, 2014);

Date dateTwo = new Date(4, 18, 2014);

int difference;

difference = dateOne.difference(dateTwo);

System.out.println("the difference between " + dateOne + " and " + dateTwo + " is" + difference + " days");

The code must take into account leap year and adding or subtracting between years. Write two additional methods that you come with on your own as well.

Reference no: EM13167016

Questions Cloud

Strengths and weaknesses of three dbms software : Research Report around 800 words strengths and weaknesses of three DBMS software packages for utilization as a company-wide customer information database. Please compare Microsoft Access, Microsoft SQL Server, and Oracle.
Explain how entities are transformed into tables : 5.1-Explain how entities are transformed into tables?
String converter : String Converter: Implement a program that asks the user to input up to 20 strings (stopping when the user inputs 0). Store these strings in a 2-dimensional array. Replace all the characters that are upper-cased to their lower-case equivalent.
Prefetching is a technique that leverages predictable : Prefetching is a technique that leverages predictable address patterns to speculatively bring in additional cache blocks when a particular cache block is accessed. One example of prefetching is a stream buffer that prefetches sequentially adjacent..
The code must take into account : The code must take into account leap year and adding or subtracting between years. Write two additional methods that you come with on your own as well.
Becoming cluster master and successfully : HCHLock lock, what will happen if the time between becoming cluster master and successfully splicing the local queue into the global queue is too small? Suggest a remedy to this problem.
Detennine the transition width in hz : 1. A rectangular window with 25 terms is used to design a low pass FIR filter. The pass band edge is located at 2 kHz and the pass band gain is about 0 dB. For a samplin frequency of 20 kHz:
Distribute music on the internet. : an architecture for a system (such as iTunes) that is used to sell and distribute music on the Internet. What architectural patterns did you use as the basis for this architecture? Why are these patterns appropriate?
Express the relationships graphically with an e-r diagram. : A vendor builds multiple types of tablet computers. Each hs a type identification number and a name. The key specifications for each type include amount of storage and display type.

Reviews

Write a Review

JAVA Programming Questions & Answers

  Distance traveled modification

Distance Traveled Modification

  Write a program to register students for a college

Students have names, addresses and courses. Implement the interface class RegisterStudent. RegisterStudent has one method, public boolean register, which returns the boolean value of true or false if the student is successfully registered for the ..

  Implement a fish-lake simulation

Implement a Fish/Lake simulation similar to the previous assignment. You will then make adjustments to accommodate class hierarchies and make use of inheritance as well as a JAVA interface.

  Compilation and Execution - JAVA problem

Style marks are based on how your submitted code looks. Remember that good code is easily readable (and understandable) by someone who did not write it. For assignments, you should also include your name, student number, what course this is, what ass..

  Program to translates a number into the closest letter grade

Write a program that translates a number into the closest letter grade. For example, the number 2.8 (which might have been the average of several grades) would be converted to B-. Break ties in favor of the better grade

  The program reads in names

Write a program and include the following methods. The program reads in names and ages (use 2 parallel arrays, maximum size 50) from a file called Stuff.dat.

  Personalize the time zone application of section 24.3

Personalize the time zone application of Section 24.3. Prompt the user to log in and specify a city to be stored in a profile. The next time the user logs in, the time of their favorite city is displayed automatically.

  Write a class that has three overloaded static methods

Write a class that has three overloaded static methods for calculating the areas of the following geometric shapes

  Write java program to find calories-conditional operator

Write down the answer for this program? Write down Java program (use Conditional (? Operator) which suggests number of calories a person must eat each day.

  Determine if strings are equal

Complete the recursive method match in the code below which will determine whether or not two strings match.

  Java program to write-read data from user using i-o function

Write java program to write and read data from user using I/O functions. Describe class with data members name[20],emp_id,basic pay,net pay.calculate all the allowances.

  Return a reverse queue

represent my queue object as a parameter, what the program should be doing. It should return a reverse queue

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd