logo

Crowdly

Read carefully the following program: import java.util.Scanner; public class r...

✅ Перевірена відповідь на це питання доступна нижче. Наші рішення, перевірені спільнотою, допомагають краще зрозуміти матеріал.

Read carefully the following program:

  1. import java.util.Scanner;
  2. public class root

  3. {
  4.     public static void main(String[] args)

  5.     {

  6. Scanner input = new Scanner(System.in); 

  7. double number = input.nextDouble();

  8. double a = 2;

  9. while (Math.abs(a-(number/a))>=0.25) {

  10. a = (a+(number/a))/2;

  11. }

  12. a = Math.floor(a);

  13. number = a;

  14. a = 2;

  15. while (Math.abs(a-(number/a))>=0.25) {

  16. a = (a+(number/a))/2;

  17. }

  18. a = Math.floor(a);

  19.         System.out.println((int) a);

  20.     }
  21. }

Suppose the input of this program is the integer 81. What is the value of the variable number right after the execution of line 13? 

Більше питань подібних до цього

Хочете миттєвий доступ до всіх перевірених відповідей на moodle.kent.ac.uk?

Отримайте необмежений доступ до відповідей на екзаменаційні питання - встановіть розширення Crowdly зараз!