Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

I need a pseudocode, flowchart and UML Diagram: Also need some help with some questions: #include Date.h #include using namespace std; // Start of main

I need a pseudocode, flowchart and UML Diagram:

Also need some help with some questions:

#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

// Last i elements are already in place

for (j = 0; 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

cin >> year;// Read in year

cout

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

// the holiday array

Date currentYear = { 1,1,2018 };

Date giveThanks = currentYear.thanksGiving();

holidays[5] = giveThanks;

holidaysDescription[5] = "Thanksgiving";

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

cout

for (int index = 0; index

{

// Display the holiday

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

cout

// Display the day

switch (day) {

case 0: cout

case 1: cout

case 2: cout

case 3: cout

case 4: cout

case 5: cout

case 6: cout

}

}

cout

cout

for (int index = 0; index

{

cout

}

system("pause");

return 0;

}

1.Which statements are true?

A) The value of a pointer variable might be 44FC30.

B) The * operator is used to get the address of a variable.

C) Pointer variables hold addresses of variables

D) The & operator is used to get the address of a variable.

2. Given the following diagram. We can say that ____

image text in transcribed

A) Adding 1 to y will also add 1 to x.

B) y points to x

C) the value of y is F740

D) x points y

3.Given int i,num[]={4,12,19,3};

Match each statement with what it does:

for(i=0;i

for(i=0;i

for(i=0;i

for(i=0;i

A.

prints address of i four times

B.

prints address of each element

C.

prints each element

D.

error

4.Which of these functions will double the value of an integer?

A) void doit (int& n) {

*n=2*n;

}

B) void doit(int* n) {

n*=2;

}

C) void doit(int n) {

n=n*2;

}

D) void doit(int &n) {

n*=2;

}

5 F725 F725 F740

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image_2

Step: 3

blur-text-image_3

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Students also viewed these Databases questions