1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Kazeer [188]
4 years ago
9

If the list above is named list1 and is implemented as a list, whatstatement would you use to find the number ofelements?list1.s

ize()list1.numElementslist1.lengthlist1.contains
Computers and Technology
1 answer:
vfiekz [6]4 years ago
8 0

Answer:

list1.size()

Explanation:

In order to find the number of elements in a List , we can use the size() method defined in the java.util.List interface.

This method returns an integer which corresponds to the number of elements in the list.

The usage syntax example is as follows:

int num = list1.size();

If the list referenced by list1 contains 6 elements, then this method will return the value 6.

You might be interested in
When is an original work considered public domain?
Blababa [14]

The correct answer isn’t really a choice shown. I would choose D because if a work doesn’t have a copyright symbol that doesn’t mean it’s in the public domain. In a real life situation it would be best to ask the creator before you use their work. If they say it’s in the public domain then you’re fine, but even if they say you can use it that doesn’t mean it’s in the public domain, it just means that you have permission to use it.

7 0
3 years ago
Given an array temps of double s, containing temperature data, compute the average temperature. Store the average in a variable
Ket [755]

Answer:

#include <iostream>

using namespace std;

// average function

void average(double arr[], int n) {

double total = 0;

double avgTemp;

for (int i = 0; i < n; i++)

{

 // find temperatures total

 total = total + arr[i];

}

// find average

avgTemp = total / n;

cout << "\nAverage Temperature = " << avgTemp << endl;

}

// print temps[] array

void printArray(double arr[], int n) {

for (int i = 0; i < n; i++)

{

 cout << arr[i] << "   ";

}

}

int main() {

int const k = 5;

double temps[k];

// temperature value

double tempValue;  

// Enter 5 temperatures of your choice

for (int i = 0; i < k; i++)

{

 cout << "Enter Temperature value " << i+1 << ": ";

 cin >> tempValue;

 temps[i] = tempValue;

}

// Function call to print temps[] array

printArray(temps, k);  

// Function call to print average of given teperatures

average(temps, k);        

return 0;

}

Explanation:

• Inside main(), int constant k is created to set the maximum size of array temps[].

• tempValue of  type double takes value at a given index of our temps[] array.

• the for loop inside main() is used to get tempValue from the user and store those values in our array temps[].

• after that printArray() function is called. to pass an array to a function it requires to perimeters 1) name of the array which is temps in our case. 2) maximum number of the index which is  k.

• note the syntax of void average(double arr[], int n). Since we are passing an array to the function so its formal parameters would be arr[] and an int n which specifies the maximum size of our array temps[].

6 0
3 years ago
May someone help me with this Computer Programming question? Thanks!
arlik [135]
Hey LenaNjaikoy,

What is your question, and what programming language is it associated with?

Thanks.
4 0
3 years ago
If x=50.7,y=25.3 and z is defined as integer z,calculate z=x+y​
ANTONII [103]

Answer:

Ans: 76

Explanation:

z=x+y

=50•7 + 25•3

=76#

3 0
3 years ago
With contention, a computer does not have to wait before it can transmit. a computer can transmit at anytime.
Firdavs [7]
If its true or false, Then its false.
7 0
4 years ago
Other questions:
  • Which of the Arts, A/V Technology, and Communication career cluster pathways are involved with producing a product for an audien
    8·2 answers
  • Microsoft acknowledged that if you type a res:// url (a microsoft-devised type of url) which is longer than ____ characters in i
    9·1 answer
  • In general, font size for software-generated presentation slides should be no smaller than __________ points.
    8·1 answer
  • Which term refers to actions that you would typically perform on a computer to revive it even if it functions in an unexpected m
    15·1 answer
  • Can someone help please
    12·1 answer
  • Which of the following prefixes would be best to use when measuring your own mass?
    15·1 answer
  • Information systems include all of these
    5·1 answer
  • You are setting up a small network. The customer has decided to change his internet service provider (ISP) to EtherSpeed. The IS
    9·1 answer
  • A customer in Lowe's needs help. Matt works in shipping and receiving. It isn't Matt job to work with the customer, but he knows
    15·2 answers
  • Which of the following recommendations should you follow when placing access points to provide wireless access for users within
    8·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!