Ask Question
16 April, 16:32

Which of the following segments is a proper way to call the method readData four times? Group of answer choices int i = 0; while (i < 4) { readData (); i = i + 1; } double k = 0.0; while (k! = 4) { readData (); k = k + 1; } int i = 0; while (i < = 4) { readData (); i = i + 1; } int i = 0; while (i < 4) { readData (); }

+5
Answers (1)
  1. 16 April, 20:15
    0
    int i = 0; while (i < 4) { readData (); i = i + 1; }

    Step-by-step explanation:

    the above method is proper way to call the method readData four times because it will start from zero and will call readData until i=3, if i=4 it will stop calling readData.

    double k = 0.0; while (k! = 4) { readData (); k = k + 1; }

    This is not the proper way to call readData four times because it will call readData only if k!=4 otherwise condition k!=4 will not be true and readData will not be called.

    int i = 0; while (i < = 4) { readData (); i = i + 1; }

    This is not the proper way to call readData four times because condition i<=4 will call readData five times starting from zero to 4.

    int i = 0; while (i < 4) { readData (); }

    This is not the proper way to call readData four times because it will call readData only one time i. e. value of is not incremented.
Know the Answer?
Not Sure About the Answer?
Get an answer to your question ✅ “Which of the following segments is a proper way to call the method readData four times? Group of answer choices int i = 0; while (i < 4) { ...” in 📙 Mathematics 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