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

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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