Question: In c++ with Dynamic Array Use three files .h, .cpp and main to create the code. 1.Create a class called BestJump. 2.Create a string attribute
In c++ with Dynamic Array Use three files .h, .cpp and main to create the code. 1.Create a class called BestJump. 2.Create a string attribute that stores the player's name. 3.Implement a dynamic array where you will store the heights and dates in those that the player jumps were made. 4.Use this Date class with operators to simulate the dates of each of the player's jumps.( code below ) 5.Order the heights from highest to lowest
//DATE
#include
using namespace std;
class Date
{
friend ostream &operator<<( ostream &, const Date & );
public:
Date( int m = 1, int d = 1, int y = 1900 ); // default constructor
void setDate( int, int, int ); // set month, day, year
Date &operator++(); // prefix increment operator
Date operator++( int ); // postfix increment operator
const Date &operator+=( int ); // add days, modify object
static bool leapYear( int ); // is date in a leap year?
bool endOfMonth( int ) const; // is date at the end of month?
private:
int month;
int day;
int year;
static const int days[]; // array of days per month
void helpIncrement(); // utility function for incrementing date
}; // end class Date
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
