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

  Solving programming problems

Write a computer program that will figure out the total of an order when given the amount of the order ($1000) and a sales tax rate of eight percent.

  An infix to postfix method for my java program.

an infixToPostFix method for my java program. The method must work with stacks and it should take a string as parameter. The method should be able to convert to postfix mathematic expressions such as: (12 + 4) - 23(9-6)/12. Treat the parenthesis as l..

  Identify the 5 code elements

Identify the 5 code elements for a Password class. Things like: class, instance, and final variables, accessor and mutator method, public and private specifiers for methods and member variables.i need to provide detail and descriptions for each code ..

  Explain java-oriented microprocessors presented by sun

Research the latest Java-oriented microprocessors presented by Sun. In what ways are they optimized to implement Java programs?

  Design and implement a sorting algorithm

Your task is to design and implement a sorting algorithm and running time grows as a linear function of the array

  Java problem - g queue

A queue is an ordered collection of items in which the removal of items is restricted to the FIFO ( rst in rst out) principle.

  Java program to declares integer array

Write a complete Java program to declares integer array, intArray, and initialize it to {1, 2, 3, 4, 5, 6, 7}.

  What makes a program easy to modify

Describe the order of magnitude of the code section using Big(O) notation and Explain the relationship between dynamic storage allocation and recursion.

  Create a world class that contains a 2d array

You have to create a world class that contains a 2d array then create an abstract class called organism that contains move() method the organism should move randomly one step at the time.

  Compute the temperature in centigrade

Compute the temperature in Centigrade - Display the temperatures in both Centrigrade and Fahrenheit with appropriate labels, using the + operator to concatenate the labels with the variables

  Create the html form and call the servlet to print out

1. write a calculator Servlet that adds, subtract, multiples and divides. Create the html form and call the servlet to print out the answer

  Write a method called makerow

Write a method called makeRow that is passed two arguments: an int and a String. It returns a String containing n copies of s, concatenated in a row. For instance, if we call the method with makeRow(5, "*"), the method returns *****.

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