Question: I need a pseudocode, flowchart and UML Diagram. C ++ Project 1: include Date.h #include using namespace std; // Start of main void bubbleSort(Date date[],

I need a pseudocode, flowchart and UML Diagram.

C ++ Project 1:

include "Date.h"

#include

using namespace std;

// Start of main

void bubbleSort(Date date[], int n)//is an array of dates and is the size of the array

{

int i, j;

for (i = 0; i < n - 1; i++)

// Last i elements are already in place

for (j = 0; j < n - i - 1; j++)

if (date[j] > date[j + 1])

{

Date temp = date[j];

date[j] = date[j + 1];

date[j + 1] = temp;

}

}

int main() {

// Declare arrays and variables

const int SIZE = 7; // Size of array elements

const int COUNT = 6; // Number of holidays

Date weekDays[SIZE]; // Weekday array

Date holidays[COUNT]; // Holiday array

string holidaysDescription[COUNT];

int year = 0;

Date easterSunday(04, 01, 2018); // Easter Sunday

holidays[0] = easterSunday;

holidaysDescription[0] = "Easter Sunday";

Date mothersDay(05, 13, 2018); // Mother's Day

holidays[1] = mothersDay;

holidaysDescription[1] = "Mother's Day";

Date memorialDay(05, 28, 2018); // Memorial Day

holidays[2] = memorialDay;

holidaysDescription[2] = "Memorial Day";

Date fathersDay(06, 17, 2018); // Fathers Day

holidays[3] = fathersDay;

holidaysDescription[3] = "Father's Day";

Date independenceDay(07, 04, 2018); // Independence Day

holidays[4] = independenceDay;

holidaysDescription[4] = "Independence Day";

// Prompt the user for current year

cout << "Please enter the current year: ";

cin >> year;// Read in year

cout << " ";

// Search for the date of Thanksgiving and add it to

// the holiday array

Date giveThanks = giveThanks.thanksGiving(year);

holidays[5] = giveThanks;

holidaysDescription[5] = "Thanksgiving";

bubbleSort(holidays, COUNT);//Sort the list of the array

cout << "The holidays are sorted by date: ";

for (int index = 0; index < COUNT; index++)

{

// Display the holiday

int day = holidays[index].weekday();

cout << holidaysDescription[index] << " is on " << holidays[index] << " which falls on a ";

// Display the day

switch (day) {

case 0: cout << "Sunday" << endl; break;

case 1: cout << "Monday" << endl; break;

case 2: cout << "Tuesday" << endl; break;

case 3: cout << "Wednesday" << endl; break;

case 4: cout << "Thursday" << endl; break;

case 5: cout << "Friday" << endl; break;

case 6: cout << "Saturday" << endl; break;

}

}

system("pause");

return 0;

}

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!