Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the Supreme Court of the United States. Assume no name is longer than twenty characters. Assume that scotus has been initialized in alphabetical order. Write an expression whose value is the last name stored in the array .

3
Assume that scotus is a two-dimensional character array that stores  the family names  (last names ) of the nine justices on the Supreme Court of the United States. Assume no name is longer than twenty characters. Assume that scotus has been initialized in alphabetical order. Write an expression whose value is the last name stored in the array .

LANGUAGE: C++

CHALLENGE:

Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the Supreme Court of the United States. Assume no name is longer than twenty characters. Assume that scotus has been initialized in alphabetical order. Write an expression whose value is the last name stored in the array.

SOLUTION:



scotus[8]

3 comments

  • Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the Supreme Court of the United States. Assume no name is longer than twenty characters . Assume that scotus has been initialized in alphabetical order. Write some code that will print each to standard output , each on a separate line with no other characters .
    for (int i = 0; i < 9; ++i)

    {
    int j = 0;
    while (j < 20 && scotus[i][j] != '')
    {
    cout << scotus[i][j];
    j++;
    } // end while

    // go to next line
    cout << endl;
    } // end for

  • Rbnsdjn says:

    Assume that scotus is a two-dimensional character array that stores the family names (last names ) of the nine justices on the Supreme Court of the United States. Assume no name is longer than twenty characters . Assume that scotus has been initialized in alphabetical order. Write some code that will print each to standard output , each on a separate line with no other characters .

  • Poop says:

    This will print out the names of the justices each time the code is looped.

    for (int i = 0; i < 9; ++i)
    {
    cout << scotus[i] <<endl;

    }

Add comment