Use VisualStudio (2019) to compile/execute.
// from: Savitch. Absolute C++. #include #include “DayOfYear.h” using namespace std; int main() { DayOfYear canadianDay; canadianDay.set(7, 1); canadianDay.output(); DayOfYear *ptrNewYear; ptrNewYear = new DayOfYear();…
#pragma once class A; //Forward Declaration class B { private: int _b; // A::show is a friend function to class B // so A::show has…
// from: https://en.cppreference.com/w/cpp/language/default_constructor #include using namespace std; struct A{ int x; A(int x = 1) : x(x) {} // User-defined default constructor. // If no…
// inspired from: https://docs.microsoft.com/en-us/cpp/cpp/program-termination?view=vs-2019 // abort.cpp #include #include class ShowData { public: // Constructor opens a file. // This constructor is called when the sd1…
// from: Savitch. Absolute C++ #include #include “HourlyEmployee.h” using namespace std; HourlyEmployee::HourlyEmployee() : Employee(), _wageRate(0), _hours(0){ } HourlyEmployee::HourlyEmployee(string name, string ssn, double wageRate, double hours)…
// from: Savitch. Absolute C++ #pragma once #include “Employee.h” class HourlyEmployee : public Employee{ public: HourlyEmployee(); HourlyEmployee(string name, string ssn, double wageRate, double hours); HourlyEmployee(const…
// from: https://en.cppreference.com/w/cpp/language/aggregate_initialization #include #include struct S { int x; struct Foo { int i; int j; int a[3]; } b; }; union U {…
//! @file //! @brief Header file for DerivedJRectangleFromAbstractGeometricObject.cpp //! #ifndef JRectangle_H #define JRectangle_H #include “AbstractGeometricObject.h” //! Rectangle class that is a subclass of the GeometricObject…