Ask Question
30 September, 00:08

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. 30 September, 00:33
    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 the answers seem to be not correct or there’s no answer. Try a smart search to find answers to similar questions.
Search for Other Answers