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 32 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
:D TYSM


deja

  • Member
  • Posts: 332
Reply 3 on: Yesterday
Thanks for the timely response, appreciate it

 

Did you know?

It is widely believed that giving a daily oral dose of aspirin to heart attack patients improves their chances of survival because the aspirin blocks the formation of new blood clots.

Did you know?

Carbamazepine can interfere with the results of home pregnancy tests. If you are taking carbamazepine, do not try to test for pregnancy at home.

Did you know?

There are actually 60 minerals, 16 vitamins, 12 essential amino acids, and three essential fatty acids that your body needs every day.

Did you know?

Many of the drugs used by neuroscientists are derived from toxic plants and venomous animals (such as snakes, spiders, snails, and puffer fish).

Did you know?

It is difficult to obtain enough calcium without consuming milk or other dairy foods.

For a complete list of videos, visit our video library