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

  Op-codes-add microcode to overlapping address ranges

Bmov a,b,n. This Block Move instruction moves n bytes of data from location a in memory to location b. Deal correctly with case of overlapping address ranges.

  Whether a string is a palindrome or not

Please examine the attachment, this is as far as I got, however I am able to compile but when executing I get and error. Please select palindrome files to save in the pals.txt file.

  Write pseudocode for procedure construct-optimal-bst

Write pseudocode for procedure Construct-Optimal-BST (root) which, table root, outputs structure of the optimal bimary search tree.

  You have in your program an arraylist which contains

you have in your program an arraylist that contains employee salaries double type in arbitrary order. you need to

  Write computer code to compute determinant of matrix

Write computer code to compute the determinant of matrix for all n between 2 and 9. Use factoriadic numbers to create all permutations.

  Creating a program that works as a grammar checker

My project is about creating a program that works as a grammar checker for Arab students of age 15+. I’m not asking you to create a grammar checker from the scratch, but you will be given bellow the mistakes that needs to be corrected.

  Write program in java to input basic salary of persons

Write the program in java to input basic salary of 15 persons. Each one of them gets 25% of basic as hra (house rent allowance), 15 % of basic as conveyance and 10 % of basic as entertainment allowance.

  Create method to generate random integers

Create a method named posNeg which generates 1000 random integers. Range of numbers must be from -5 to +5 inclusive.

  Write program to will read unspecified number of positive

Write a program which will read the unspecified number of positive numbers from keyboard and determine the sum and average of these numbers.

  Differentiating heavyweight and lightweight process

What is the difference between a heavyweight and a lightweight process? Give an example of where heavyweight processes are appropriate.

  A method to calculate the value of the entire inventory

Create a method to calculate the value of the entire inventory. Create another method to sort the array items by the name of the product.

  Write program to open the text file-reads its contents

Write down a program which opens the text file and reads its contents into the stack of characters. Program must then pop characters from stack and save them in second text file.

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