This topic contains a solution. Click here to go to the answer

Author Question: What is the output of the following code?double[] myList = {1, 5, 5, 5, 5, 1};double max = ... (Read 33 times)

mynx

  • Hero Member
  • *****
  • Posts: 555

Question 1

Assume int[] t = {1, 2, 3, 4}. What is t.length?
◦ 3
◦ 0
◦ 4
◦ 5

Question 2

What is the output of the following code?

double[] myList = {1, 5, 5, 5, 5, 1};
double max = myList[0];
int indexOfMax = 0;
for (int i = 1; i < myList.length; i++) {
if (myList[i] > max) {
max = myList[i];
indexOfMax = i;
}
}
System.out.println(indexOfMax);

◦ 0
◦ 1
◦ 2
◦ 3
◦ 4


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by mynx on May 6, 2020

nothere

  • Sr. Member
  • ****
  • Posts: 324
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




mynx

  • Member
  • Posts: 555
Reply 2 on: May 6, 2020
Wow, this really help


aliotak

  • Member
  • Posts: 326
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

Critical care patients are twice as likely to receive the wrong medication. Of these errors, 20% are life-threatening, and 42% require additional life-sustaining treatments.

Did you know?

Many medications that are used to treat infertility are injected subcutaneously. This is easy to do using the anterior abdomen as the site of injection but avoiding the area directly around the belly button.

Did you know?

Fungal nail infections account for up to 30% of all skin infections. They affect 5% of the general population—mostly people over the age of 70.

Did you know?

Blood is approximately twice as thick as water because of the cells and other components found in it.

Did you know?

Blood in the urine can be a sign of a kidney stone, glomerulonephritis, or other kidney problems.

For a complete list of videos, visit our video library