The class date was designed and implemented

Assignment Help JAVA Programming
Reference no: EM13876423

In Programming Exercise 2, the class Date was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class date so that, it addition to the operations already defined, it can perform the following operation on a date:

a.  Set the month.

b.  Set the day.

c.  Set the year.

d.  Return the month.

e.  Return the day.

f.  Return the year.

g.  Test whether the year is a leap year.

h.  Return the number of days in the month. For example, if the date is 3-12-2015, the number of days to be returned is 31, because there are 31 days in March.

i.  Return the number of days passed in the year. For example, if the date is 3-18-2015, the number of days passed in the year is 77. Note that the number of days returned also includes the current day.

j.  Return the number of days remaining in the year. For example, if the date is 3-18-2015, the number of days remaining in the year is 288.

k.  Calculate the new date by adding a fixed number of days to the date. For example, if the date is 3-18-2015 and the days to be added are 25, the new date is 4-12-2015.

l.  Return a reference to the object containing a copy of the date.

m.  Make a copy of another date. Given a reference to an object containing a date, copy the data members of the object into the corresponding data members of this object.

n.  Write the definitions of the methods to implement the operations defined for the class Date.

****Please only submit original content and send in .txt format along with a pic of the output.

Reference no: EM13876423

Questions Cloud

Prepare a budgeted income statement : Cameron Parts has the following data from year 1 operations, which are to be used for developing year 2 budget estimates:
Sunk costs concept associated with making capital investment : Define the sunk costs concept associated with making capital investment decisions. Discuss why this concept is important for the investor to factor into the decision-making process.
Write a java program that stores these integers : 3. Write a java program that stores these integers 10, 20, 30, 40, 20 in an array named nums. Write the code to count all the occurrences of 20 and then display the count.
Define and discuss the concepts of risk and return : Define and discuss the concepts of risk and return. Also discuss the importance of portfolio diversification and its relationship to risk and return.
The class date was designed and implemented : In Programming Exercise 2, the class Date was designed and implemented to keep track of a date, but it has very limited operations. Redefine the class date so that, it addition to the operations already defined, it can perform the following operation..
Compute the adequate positions in the hedging instruments : You currently hold a 7-year fixed rate bond 5% annually. You would like to hedge against changes in the level and the slope of the yield curve and you plan to use a 1-year zero coupon bond and a 7-year zero coupon bond. Use the following table to com..
Instantiate a circle by giving its radius and use : Write a class Circle.java from which we can instantiate a circle by giving its radius and use it as is shown in the following program. 1 import java.util.Scanner; 2 public class Circles {
Old manufacturing equipment with an annual depreciation : Refer to the data in Problem. Estimate the cash from operations expected in year 2.In Problem, Cameron Parts has the following data from year 1 operations, which are to be used for developing year 2 budget estimates:
Eoq model- very large increase in sales will result : According to the EOQ model, a very large increase in sales will result in

Reviews

Write a Review

JAVA Programming Questions & Answers

  What wc produces on a linux system

Write a Java program (completely documented according to the class documentation guidelines, of course) named Prog3.java that counts lines, words, and bytes (characters) of text files.

  Design a java application to carry out additions

You are to design a Java application to carry out additions and subtractions for numbers of any length - You are not allowed to convert these strings to numbers before the operation.

  Write a method insert at that takes an array of integers

Write a method, insertAt, that takes four parameters: an array of integers; the length of the array; an integer, say, insertItem; and an integer, say, index

  Uml exercise automated teller machine atmnbspbrief

uml exercise automated teller machine atmnbspbrief statement of purposean atm is an electronic device designed for

  Balancing binary search trees

Balancing Binary Search Trees,  Consider the file BST.java (a link to this file is provided below for downloading purposes) which defines a generic Binary Search Tree class.

  Create a program that simulates a slot machine

Create a program that simulates a slot machine. To decide which loop structures to use, such as while, do while, and for loop in Java. To use decision structures such as if, if-else, and switch statements in Java

  Write a recursive program

Write a recursive program to compute the number of ways in which an integer k can be written as sum

  Programming sorting algorithms

Describe an approach to modifying the Sorts.java program so that after calling a sorting method the program prints out the number of swaps needed by the sorting method.

  Create a class named box that includes integer data fields

Create a class named Box that includes integer data fields for length, width and height. Create three constructors that require one, two and three arguments, respectively.

  Eliminate the last comma in the string output

Eliminate the last comma in the String Output which includes array output values from "hourlyTemp[i]" (entire list). My guess is that this needs to incorporate "%d" somehow but my online book won't accept the use of "%d" for some reason. From the boo..

  Write program that takes theelevator-nxtthrough calibration

Write the program that takes theElevator-NXTthrough a calibration and test sequence, as shown in thisvideo. Raise the car as far as it goes to the top (the top floor).

  Using an array in java

Using an array in Java - have a list of keywords from a web service and have to print out the list of keywords on the screen with one keyword on each line. This is my code

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