Ask Question
12 May, 11:06

StackOfStrings s = new StackOfStrings (); while (! StdIn. isEmpty ()) { String item = StdIn. readString (); if (! item. equals ("-")) s. push (item); else if (s. isEmpty ()) StdOut. println ("BAD INPUT"); else StdOut. print (s. pop () + " "); }

+3
Answers (1)
  1. 12 May, 11:59
    0
    Explanation

    Question 1:

    ! StdIn. isEmpty () is false.

    So, it does not run the loop body.

    So, It does not print anything.

    Answer:

    none of these

    Question 2:

    If we print the list starting at x, the result would be: 2 3

    Answer:

    none of these
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “StackOfStrings s = new StackOfStrings (); while (! StdIn. isEmpty ()) { String item = StdIn. readString (); if (! item. equals ("-")) s. ...” in 📙 Engineering if there is no answer or all answers are wrong, use a search bar and try to find the answer among similar questions.
Search for Other Answers