Write a program that design a class named month

Assignment Help Programming Languages
Reference no: EM131299905

Assignment

Month Class

Design a class named Month . The class should have the following private members:

• name A string object that holds the name of a month, such as "January," "February," etc.

• monthNumber An integer variable that holds the number of the month. For example, January would be 1, February would be 2, etc. Valid values for this variable are 1 through 12.

In addition, provide the following member functions:

• A default constructor that sets monthNumber to 1 and name to "January."

• A constructor that accepts the name of the month as an argument. It should set name to the value passed as the argument and set monthNumber to the correct value.

• A constructor that accepts the number of the month as an argument. It should set monthNumber to the value passed as the argument and set name to the correct month name.

• Appropriate set and get functions for the name and monthNumber member variables.

• Prefix and postfix overloaded ++ operator functions that increment monthNumber and set name to the name of next month. If monthNumber is set to 12 when these functions execute, they should set monthNumber to 1 and name to "January."

• Prefix and postfix overloaded -- operator functions that decrement monthNumberm and set name to the name of previous month. If monthNumber is set to 1 when these functions execute, they should set monthNumber to 12 and name to "December."

Also, you should overload cout 's << operator and cin 's >> operator to work with the Month class. Demonstrate the class in a program.

Reference no: EM131299905

Questions Cloud

Problem regarding the data controls : You learned in your readings that there are a variety of data controls and data source controls. That can be confusing to beginners. Data source controls manage the connection and command and data controls help manage presenting the content.
Fin102 assignment-global financial crisis : The Global Financial Crisis is the most significant worldwide economic catastrophe since the Great Depression of 1929; sub-prime mortgage crisis is an example of financial crisis that affected global financial market worldwide. What are other example..
What is the purpose of your mission trip : MAT-144 Mission Project. What is the purpose of your mission trip? In general, mission trips fall into three categories - providing aid in the form of supplies, providing education, and providing services such as medical clinics and building house..
What rate of return should jacobs require on a project : What rate of return should Jacobs require on a project of average risk?- If a new venture is expected to have a beta of 1.6, what rate of return should Jacobs demand on this project?
Write a program that design a class named month : Design a class named Month . The class should have the following private members: name A string object that holds the name of a month, such as "January," "February," etc.
Main types of linux commands : Which of the following is not one of the three main types of Linux commands?
Create a text file with one record of text data : Create a text file with one record of text data. This text file will be read by the program and the data in the text file will serve as a search term.
Write a system to read from a file list of employee payroll : Write a system to read from a file a list of employee payroll information, calculate net salary amounts based on base salary, bonus, and % deduction.
What is the current market price of these bonds : Western Enterprises' bonds have 10 years remaining to maturity. Interest is paid annually, the bonds have a $1,000 par value, and the coupon rate is 9 percent. The bonds have a yield to maturity of 7 percent. What is the current market price of th..

Reviews

Write a Review

Programming Languages Questions & Answers

  Write a haskell program to calculates a balanced partition

Write a program in Haskell which calculates a balanced partition of N items where each item has a value between 0 and K such that the difference b/w the sum of the values of first partition,

  Create an application to run in the amazon ec2 service

In this project you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application.

  Explain the process to develop a web page locally

Explain the process to develop a Web page locally

  Write functions

These 14 questions covers java class, Array, link list , generic class.

  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 .

  Write a prolog program using swi proglog

Write a Prolog program using swi proglog

  Create a custom application using eclipse

Create a custom Application Using Eclipse Android Development

  Create a application using the mvc architecture

create a application using the MVC architecture. No scripting elements are allowed in JSP pages.

  Develops bespoke solutions for the rubber industry

Develops bespoke solutions for the rubber industry

  Design a program that models the worms behavior

Design a program that models the worm's behavior.

  Writing a class

Build a class for a type called Fraction

  Design a program that assigns seats on an airplane

Write a program that allows an instructor to keep a grade book and also design and implement a program that assigns seats on an airplane.

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