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

  Write a program to test your class definition

Do not define an input method. The only method that can set the counter is the one that sets it to zero. Write a program to test your class definition.

  Questions1 design and implement an applet called circles

questions1. design and implement an applet called circles that draws 50 circles of random diameter in random locations.

  Implement a shopping cart class with user interface

project will be to implement a shopping cart class with user interface (UI) that contains main() in Net Beans. The UI class will be used to perform user input/output and to invoke the appropriate methods of shopping cart class. When your program star..

  Write a java program that uses the elapsed time

Write a Java program that uses the elapsed time for an event in second and then outputs the elapsed time in hours, minutes and seconds. (For case, if the desired time is 9630 seconds, then the output is 2: 40: 30)

  Implement security so that all users can view the informatio

Implement security so that all users can view the information about the projects, but only authenticated users

  Organizational report

You have been hired as the CIO of a large multinational Internet advertising company. The president of the company is entertaining a major new software development project to keep track of advertising revenues.

  Prepare a mobile android app

The app should target Android and be written in Java, unless you have obtained prior permission from your instructor to target a different platform

  Write a class harvardlawyer to accompany

Write a class HarvardLawyer to accompany the other law firm classes described in this chapter (Ch 9 of Building java programs; a back to basic approach).

  Write a class called rationalnumber

Write a class called RationalNumber that represents a fraction with an integer numerator and denominator.

  Writing a simple gui application using a class called myguic

writing a simple GUI application using a class called MyGuiClass. Your GUI will have a JButton which your program will need to respond to when it is clicked. Describe what you would need to do to setup event handling using a nested inner class. Use J..

  Imagine that you have been assigned

Imagine that you have been assigned to implement a sorting program. The goal is to make this program general purpose, in that you don't want to define in advance what record or key types are used

  How do i automatically set the input focus in my applet

How do I automatically set the input focus in my applet to a specific component/text field when the browser loads the page that contains the applet?

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