Function to retrieve each of the private data members

Assignment Help Programming Languages
Reference no: EM1354017

Q1) Write a class called "Date" with month, day and year as the private members. Have a constructor which sets default date to 1st January 2000. Have an accessor function which retrieves each of the private data members. Also have mutator functions which set valid values for date as well as each of the private data members. For any invalid entry, set the date to the default value. Finally have a printDate() function which prints date in the following format: mm-dd-yyyy - pad with 0s wherever necessary.

In your client program have a function called "void IncrementMonth (Date &, int)"

Experiment with setting dates to valid values, invalid values and increment month to 6 months, 12 months and 15 months. Adjust the day and year accordingly. Print out the starting date before you make any increments.

Reference no: EM1354017

Questions Cloud

Find the value added from acquisition of the player : The general manager of the Miami Dolphin a NFL Team is planning paying $2.5 million per year for a Star player, along with a 2$ million up front signing bonus.
Show organizational structure design : Explain the executive, managerial, and administrative organization of a firm and indicates responsibility and hierarchical relationships.
Apollo shoes audit : Obtain an understanding of the company, its internal control, and its audit risk factors (including the risk of material misstatements due to fraud).
How far to the right of the center of the circle : Two charged dust particles exert a force of 8.5 x10-2 N on each other. What will be the force if they are moved so they are only one-seventh as far apart.
Function to retrieve each of the private data members : Write a class called "Date" with month, day and year as private members. Have constructor that sets default date to 1st January 2000. Have accessor function which retrieves each of the private data members.
Explain about reward structure : Potential inadvertent cause may help understand why it is possible for highly ethical leaders to preside over an organization that commits several unethical acts.
Real life case for decision making : Provide three real-life examples of problems for which it would be helpful to go through the problem-solving stages. Discuss your answer to the question concerning this scenario:
Among which of the following us policies and institutions : Among which of the following U.S. policies and institutions may negatively influence U.S. long-run economic growth.
Considering the internal control component : Which of the following describes the internal control component "monitoring of controls"?

Reviews

Write a Review

Programming Languages Questions & Answers

  Smallest and largest values in element floating-point array

Copy 11-elemts array source into first portion of 34-element array sourceCopy. Find out the smallest and largest values in 99-Element floating-point array data.

  Application to print the sum of cubes

Write down the application to print the sum of cubes. Prompt for and read two integer values and print sum of each value raised to third power.

  Programming assignment

If the user wants to read the input from a file, then the output will also go into a different file . If the user wants to read the input interactively, then the output will go to the screen .

  Code to sum of all the elements of the array

Write some code that places the sum of all the elements of the array x into total. Declare any variables that you need.

  Program to read from an input file

Write a program to read from an input file for 15 students, that contains each individual student ID, the course code, letter grade, and credit hours for five courses.

  Program to calculate and displays number of miles per hour

Design a program to calculate and displays the number of miles per hour over the speed limit that a speeding driver was doing

  Write code for invoking method named sendtwo

Write the code for invoking a method named sendTwo. There are two arguments for this method: a double and an int.

  Methods to declare and initialize one dimensional arraay

What is an array? Show different methods to declare and initialize one dimensional array. Draw how an integer array of 6 elements having base address 5001 is stored in memory.

  What are the contents of given register

Memory location 2000H has the word 5000H stored in it. What does each location contain after INC BYTE PTR[2000H]. Also after DEC WORD PTR[2000H]

  Design application that gets customer account data

Design an application that gets customer account data that includes an account number, customer name, and balance due.

  Method to pass string argument and returns first line

Write a method, getFirstLine, that is passed a String argument and that returns the first line.

  Program to enter up to 20 integers in the array of long

Write down a program which asks user in order to enter up to 20 integers in the array of longs.The program must utilize the function Find_It() in order to situate the integer within the array.

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