Course Hero Logo

Void foo int c if a b c a else c b systemoutprintlnc

Course Hero uses AI to attempt to automatically extract content from documents to surface to you and others so you can study better, e.g., in search results, to enrich docs, and more. This preview shows page 13 - 18 out of 18 pages.

void foo (){int c;if (a >= b)c = a;elsec = b;System.out.println(c);}Select one:b.BQuestion 37Which of the following methods receives two integers and returns a double value?Select one:b.double foo (int a, int b);
Question 38Which of the following implements a method, receives two integers, and returns their sum?
int c = a + b;return c;}C.sum (int a, int b){c = a + b;return c;}D.int sum (int a, int b){c = a + b;return c;}Select one:a.AQuestion 39Given the method declaration: int sub (int x, int y), which of the following declares an overloadedmethod?Select one:
Question 40Which of the following correctly calls the method void sum (double x, double y)?
a.void sum (7.8, 5.6);b.void sum (p, q);c.sum (p, q);d.sum (double p, double q);Question 41Which of the following correctly calls the method int sum (int x, int y)?Select one:a.int t = int sum (m, n);b.int t = sum (int m, int n);c.int t = int sum (20, 30);d.int t = sum (20, 30);
Question 42Which of the following code declares a double type array and allocates memory for 8 integer values?Select one:
Question 43Which of the following doubles the value of the 2ndelement in an array?Select one:
Question 44Which of the following code creates and initializes a two-dimensional integer type array?Select one:
Question 45Given int [ ] hours = {7, 9, 6, 7, 11}, which of the following calculates the total?Select one:a.int total = 0;for(int i = 0; i < 5; i++)total = total + hours [i];
Question 46Given int [ ] scores = {60, 70, 80, 90, 100}, which of the following finds the lowest score?Select one:
{if (lowest < score[i])lowest = score[i];}d.int lowest = 100;for(int i = 0; i < 5; i++){if (lowest > score[i])lowest = score[i];}Question 47Which Java package includes the scanner class?

Upload your study docs or become a

Course Hero member to access this document

End of preview. Want to read all 18 pages?

Upload your study docs or become a

Course Hero member to access this document

Term
Fall
Professor
Dr. Alae Loukili
Tags
Object Oriented Programming, following statements, int y

Newly uploaded documents

Show More

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture

  • Left Quote Icon

    Student Picture