C++ Lab 16 Report Date and Time - 76016

Solution Posted by
jordanblink

jordanblink

Rating : (19)A+
Solution Detail
Price: $10.00
Request Description
Class relationships and initialization lists Attached Files: • lab16files.tgz (705 B) For this lab write a Report class based on the class diagram shown above. The Report class relies on both the Date class and the Time class. The Date and Time classes are attached (see link above diagram), along with a source file containing the main-function that should be used. As shown in the diagram, you must write two member functions for the Report class: 1. A six-parameter constructor. The six parameters should be in the following order: month, day, year, hour, minute, description. Use an initialziation list to pass these six parameters into the constructors of Report's private data. 2. A display function. Report's display function's output should look like: Report date: Report time: Report desc: There is a content overview associated with this lab: 08 Class relationships: composition. This can be found in Quizzes. 08 Class relationships: composition Content • External resources Composition, or the "has-a" relationship is one way to allow one C++ object to communicate with another. It's name comes from one class being composed of (in part) another class. This relationship is established when an object of one class is (private) data of another class. o http://www.learncpp.com/ 1. Section 10.1 2. Section 10.2 o http://www.learncpp.com/cpp-tutorial/102-composition/ o https://sites.google.com/site/gbswebportfolio/projects/c-composition-example
Solution Description

C++ Lab 16 Report Date and Time

Class relationships and initialization lists

Attached Files:

 

 

 

For this lab write a Report class based on the class diagram shown above. The Report class relies on both the Date class and the Time class. The Date and Time classes are attached (see link above diagram), along with a source file containing the main-function that should be used. As shown in the diagram, you must write two member functions for the Report class:

  1. A six-parameter constructor. The six parameters should be in the following order: month, day, year, hour, minute, description. Use an initialziation list to pass these six parameters into the constructors of Report's private data.
  2. A display function. Report's display function's output should look like:

 

Report date:

Report desc: