ComputerScienceExpert

(11)

$18/per page/

About ComputerScienceExpert

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Applied Sciences,Calculus See all
Applied Sciences,Calculus,Chemistry,Computer Science,Environmental science,Information Systems,Science Hide all
Teaching Since: Apr 2017
Last Sign in: 103 Weeks Ago, 3 Days Ago
Questions Answered: 4870
Tutorials Posted: 4863

Education

  • MBA IT, Mater in Science and Technology
    Devry
    Jul-1996 - Jul-2000

Experience

  • Professor
    Devry University
    Mar-2010 - Oct-2016

Category > Programming Posted 24 May 2017 My Price 8.00

C++ program segments

5. Show the output of each of the following C++ program segments:

int j;

int one[5], two[10];

for (j = 0; j < 5; j++)

one[j] = 5*j + 3;

cout << “One cntains: “;

for (j = 0; j < 5; j++)

cout << setw(3) << one[j];

cout << endl;

for (j = 0; j < 5; j++)

{ two[j] = 2*one[j] - 1;

two[j + 5] = one[4 - j] – 1 + two [j];

}

cout << “Two cntains: “;

for (j = 0; j < 10; j++)

cout << setw(3) << two[j];

cout << endl; 

**********************************************************************************

const int n = 6;

int L[n] = {3, 5, 5, 4, 9, 9};

bool valu = true;

int k = 0;

while ( (k <n-1) && (valu) )

{

if (L[k] > L[k+1])

{

valu = false;

cout << setw(2) << k << setw(2) <<L[k] << endl;

}

else

k++;

}

if (valu)

cout << “ The list is OK” << endl;

Answers

(11)
Status NEW Posted 24 May 2017 06:05 AM My Price 8.00

-----------

Not Rated(0)