The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 304 Weeks Ago, 1 Day Ago |
| Questions Answered: | 15833 |
| Tutorials Posted: | 15827 |
MBA,PHD, Juris Doctor
Strayer,Devery,Harvard University
Mar-1995 - Mar-2002
Manager Planning
WalMart
Mar-2001 - Feb-2009
I don't understand how to complete these three assignments. Can someone like give me an example of something because i can't figure it out.Here are the problems in the attached section. The below question i can't seem to figure out how to do also.Â
Write a program that will have 4 functions:
-Â Â Â Â Â Â Â Â Â input an arrayÂ
               void inputData( istream &, int [], int);
-         print an array Â
               void printData( ostream &, const int [], int);
-Â Â Â Â Â Â Â Â Â copy one array to another array in normal order
                                                     void copyArray( const int orig[], int dup[], int);
NOTE:       Driver - allocate memory for both arrays. Supply the data for the 1st array. Call the copyArray functionÂ
                       int a[4] = { 7, 14, 9,10};
                       int b[4];
                       copyArray(a,b,4);
                       printData(cout,b,4);
               THE OUTPUT WILL BE:
                    7
                    14
                    9
                    10
The student should NOT create a local array inside the copyArray function. The reasons is that the local array inside the function
only exists while the function is executing. After the function returns, all of the local memory is reclaimed.
-Â Â Â Â Â Â Â Â Â copy one array to another array in reverse order
           void revCopy( const int orig[], int rev[], int);
   Write the main program to test the four functions you wrote
----------- Â ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly