Write a test program to test your class implementations

Assignment Help Computer Engineering
Reference no: EM132151521

Task:

Write a program that defines a class Date and implement it as required. The class Date should consist of three private member variables: year of type int, month of type int, and day of type int. The class Date should also include the following public member functions:

1.to output the year, month, and day in the format of yyyy-mm-dd.

2.to set the year, month and day according to the parameters. Data validation should be provided. A valid year is an integer between 1900 and 2015 inclusively. A valid month is an integer between 1 and 12 inclusively. A valid day should be an integer between

1 and n, where n = 31 if month is 1, 3, 5, 7, 8, 10, or 12; n = 30 if month is 4, 6, 9, or 11; n = 28 if month = 2.

Use 1900 for the year, 1 for the month, and 1 for the day, respectively, if a data is invalid.

3.to return the year.

4.to return the month.

5.to return the day.

6.A constructor to initialize year, month, and day with default parameters: The default values of year, month, and day are 1900, 1, and 1 respectively.

7. to compare two objects' values. Return true if they are the same, otherwise, return false. has a formal parameter which is a object.

You should put the class definition in a header file Date.h and put the class implementation in an implementation file Date.cpp. Write a test program to test your class implementations.

Reference no: EM132151521

Questions Cloud

Draw an eer diagram and their relationships : Draw an EER diagram and their relationships. Make sure you pay attention to ERD notations and naming conventions.
Given that x is normally distributed : find the probability that X is less than 309.5, given that we know that X is larger than 288.4. State your answer rounded to 3 places of decimal.
Concepts of mutually exclusive events : What are the two basic rules of probability? Relate these rules to the concepts of mutually exclusive events and independent events.
What is the probability of drawing a club : One card is selected randomly from a standard 52-card deck. a. What is the probability of drawing a club?
Write a test program to test your class implementations : Write a program that defines a class Date and implement it as required. The class Date should consist of three private member variables.
Prepare a functional description on the selected system : Prepare a functional description on the selected system (a collection of related programs) or program.
How you would approach testing the qc managers : Explain how you would approach testing the QC managers' concern. What type of tests/CI you would construct to help him make a decision?
Ask for times for each race in hours-minutes and seconds : You will need to store the input in an array so that you can output them at the end. Obviously the words FASTEST and SLOWEST should be on the correct line.
Which of the following statements are true : Suppose that the last RTT sample at host A is 10 msec. The current value of the RTT estimate must be greater than or equal to 10 msec.

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain the limitations of the given technology

Of the numerous forms of communication technologies presented in this course, predict the first form of technology to be phased out by a newer and improved.

  Discuss and develop a risk assessment report for a company

The objective of this assignment is to develop a Risk Assessment Report for a company, government agency, or other organization

  Security management model

Write down the sites which will discuss the ongoing responsibilities of security manager, can be adapted for use within the security management model?

  Questionsome of your friends work on wireless networks and

questionsome of your friends work on wireless networks and theyre at present studying the properties of a network of n

  Implement a fast 16-bit cmos adder

EECS 170D Project. Your task is to implement a fast 16-bit CMOS adder. You can implement any kind of adder EXCEPT for a standard static ripple adder. So, for example, you can implement a carry-skip or carry look-ahead adder, Laner-Fischer, Brent-K..

  Define computer systems and computer programs

What can be defined as a premeditated, politically motivated attack against information, computer systems, computer programs

  Returns the total charges for an oil change and lube job

Returns the total charges for an oil change and/or lube job, if any. FlushCharges: returns the total charges for a radiator flush and/or transmission flush, if any.

  Questiongenerate and display all 52 cards in a standard

questiongenerate and display all 52 cards in a standard deck of playing cards 2-10 j k q a of hearts diamonds clubs and

  Draw what that would look like and explain how it works

If we put the P-type transistors in series,and the N-type in parrallel, it will will form a 2-input NOR gate.

  Indicate what the advantage of the shaker sort might be

The shaker sort is an adaptation of the bubble sort that alternates the direction. Indicate what the advantage of the shaker sort might be.

  Application to computer science

Find the matrices that represent the relations.

  What steps are involved for implementing

What steps are involved for implementing sw $s0 , 0 ( $s1) instruction . Draw data path and control path for this instruction.

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