Ask Question
23 October, 04:56

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 (); }

+3
Answers (1)
  1. 23 October, 07:56
    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?
Find 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 you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers