A class definition for a date class that contains 3 integer

Assignment Help C/C++ Programming
Reference no: EM13939148

1. A class definition for a Date class that contains three integer data members: month, day, and year.

2. One constructor that assigns the date 1/1/2000 to any new object that does not receive any arguments.

3. One constructor that accepts month and day arguments and uses a default year of 2004.

4. One constructor that accepts month, day, and year arguments.

5. Each constructor should also output a message to the user stating which constructor is currently being used.

6. A method that displays the values in the Date object.

7. A Main() program in which you:

a. Instantiate three Date objects - create one for each type of constructor (no argument, 2-argument, 3-argument).

b. For the 2-argument and 3-argument constructor prompt the user for console input of the month, day or month, day, year.

c. Display output for each of the three constructor types.

8. Internal Documentation

Your output should look something like this:

Implementing overloaded constructors program
************************************
Using no-argument constructor, assigning date 1/1/2000
The date in this object is 1/1/2000
************************************
Enter a month eg: 10 for October: 10
Enter a day eg: 24: 24
Using 2-argument constructor, assigning year 2004
The date in this object is 10/24/2004
************************************
Enter a month eg: 10 for October: 8
Enter a day eg: 24: 25
Enter a year eg: 1950: 1951
Using 3-argument constructor, for mo/da/yr
The date in this object is 8/25/1951
************************************
Press any key to continue . . .

A constructor must have the same name as the class. A constructor is automatically called when an object is instantiated. A constructor is the most appropriate place to initialize data members.

Here is an example of declaring a constructor:

public class Date
{
public Date() //no argument constructor
{

...code to initialize variables

}
}

Reference no: EM13939148

Questions Cloud

Gaining a global understanding of the research : The goal of this assignment is to ensure that you have conducted a broad, comprehensive review of the literature so that you may gain a global understanding of the research in your chosen topic area.
Is reality nothing more than a joint social illusion : Why do Americans generally have such a negative and fearful approach to aging? Is this a part of our larger fear of death and dying? How might the emotional needs of dying people be better served in your local community?
Prepare journal entries for all activities relating to labor : Escuchar Products, a producer of DVD players, has established a labor standard for its product-direct labor. Compute the labor rate and efficiency variances. Prepare journal entries for all activities relating to labor.
Describe a scenario for the production and consumption : Describe a scenario for the production and consumption of a product that involves all three sectors of an economy. Explain what each sector contributes to the transactions and what each sector receives. Which sector benefits the most from the transac..
A class definition for a date class that contains 3 integer : A class definition for a Date class that contains three integer data members: month, day, and year.
Investment opportunities for australian businesses : Potential export, import and investment opportunities for Australian businesses in these three countries.
Describe and explain the business costs : Findings and Analysis: describe and explain the business costs you have researched with Harvard references. Show the individual and total costs. Use tables if you wish.
Alienation in the workplace : alienation in the workplace fetishism of commodities exploitation of workers
Define the main biological influences of psychology : Define neurotransmitters and describe their role in neurotransmission. Discuss how they are released, how they affect receiving neurons, and how they are removed from receptor sites.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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