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

  Creating a security policy by gathering information

Suppose mantle of a security consultant. You are asked to visit a client and gather information to develop a security policy for them.

  Program to compute pearson correlation coefficient

Write down a program to compute Pearson correlation coefficient by using parallel loop templates from Intel Threading Building Blocks library (TBB).

  Program to calculate the electricity bill

Write a program to calculate the electricity bill. The rates of electricity per unit are as follows: If the units consumed are equal or less than 100, then the cost is Rs 8/- per unit.

  Probability line is executed in nth iteration of for loop

What is the probability that line is executed during the nth iteration of the for loop? What is the exact expected number of executions of line?

  Write the constructor function makestk

Write the constructor function makestk, predicate function emptystk and mutator functions pushstk and popstk

  Design program to accepts account number

Design a program that accepts an account number, the account owner's first and last names, and a balance. Print the projected running total balance for each year for the next 20 years.

  Subdividing address block among four different customers

The ISP needs to subdivide the address block among four different customers, requiring 29, 28, 27, and 26 hosts respectively.

  Prolog program to reads employee-s number

Write a prolog program that reads an employee's number from the keyboard, number of hours worked and an hourly rate of pay.

  Unix systems administration

Unix Systems Administration

  Develop the algorithms needed for designer robot

You have been hired as a system designer to develop the algorithms needed for a designer robot that can paint different patterns on the floor based on the commands it receives.

  Describe issues-web site designers when adding multimedia

Describe some of the issues web site designers must consider when adding multimedia to a web site. Consider issues such as bandwidth, server load, or others you consider to be important. Please provide references.

  Applying constraints in program

You will require to set up constants in program for given: number of square feet per square yard.

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