Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

int main() { Array arr1(5), arr2(10); for (int i = 0; i < arr1.getSize(); i++) arr1[i] = i; for (int i = 0; i <

int main() { Array arr1(5), arr2(10); for (int i = 0; i < arr1.getSize(); i++) arr1[i] = i; for (int i = 0; i < arr2.getSize(); i++) arr2[i] = i; cout << "arr1 contains: " << arr1; cout << "arr2 contains: " << arr2; Array arr3(arr1); cout << "arr3 contains: " << arr3 << endl; arr2 = arr2; cout << "arr2 contains: " << arr2; arr3 = arr2; cout << "arr3 contains: " << arr3 << endl; cout << boolalpha; //Display booleans as 'true' or 'false' instead of 1 or 0 cout << "arr2 == arr3: " << (arr2 == arr3) << endl; cout << "arr1 == arr3: " << (arr1 == arr3) << endl; cout << "arr1 < arr3: " << (arr1 < arr3) << endl << endl; arr3[0] = 100; cout << "New arr3: " << arr3; cout << "arr2 == arr3: " << (arr2 == arr3) << endl; cout << "arr1 == arr3: " << (arr1 == arr3) << endl; cout << "arr1 < arr3: " << (arr1 < arr3) << endl << endl; arr1 += arr2; cout << "arr1 += arr2: " << arr1 << endl; cout << "!arr1: " << !arr1; cout << "*arr1: " << *arr1 << endl << endl; cout << "arr1++: " << arr1++; cout << "arr1 is: " << arr1 << endl; cout << "--arr1: " << --arr1; cout << "arr1 is: " << arr1 << endl; cout << "Total number of elements in all arrays: " << Array::getNumberOfElements() << endl << endl; return 0; }

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

Step: 3

blur-text-image

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

Database Design Application Development And Administration

Authors: Mannino Michael

5th Edition

0983332401, 978-0983332404

More Books

Students also viewed these Databases questions