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
Kipish [7]
3 years ago
9

Which of the following statements represents the number of columns in a regular two-dimensional array named values?

Computers and Technology
1 answer:
puteri [66]3 years ago
5 0

Answer:

(a) values[0].length

Explanation:

In programming languages such as Java, an array is a collection of data of the same type. For example, a and b below are an example of an array.

a = {5, 6, 7, 9}

b = {{2,3,4}, {3,5,4}, {6,8,5}, {1,4,6}}

But while a is a one-dimensional array, b is a regular two-dimensional array. A two-dimensional array is typically an array of one-dimensional arrays.

Now, a few thing to note about a two-dimensional array:

(i) The number of rows in a 2-dimensional array is given by;

<em>arrayname.length</em>

For example, to get the number of rows in array b above, we simply write;

<em>b.length </em>which will give 4

(ii) The number of columns in a 2-dimensional array is given by;

<em>arrayname[0].length</em>

This is with an assumption that all rows have same number of columns.

To get the number of columns in array b above, we simply write;

<em>b[0].length </em>which will give 3

Therefore, for a regular two-dimensional array named values, the number of columns is represented by: values[0].length

You might be interested in
50 Points being offered for the fastest and most correct response<br><br> How do I fix this?
kolezko [41]
Hi there!

Try resetting your browser, clearing your cache, and rebooting your computer.. If none of these work, or you've already tried these, let me know..

Hope this helps! ☺♥
5 0
3 years ago
Read 2 more answers
The instant pivot button is displayed in the statistics and visualization tabs when a _______ search is run.
Arisa [49]

Answer:

<h2>The instant pivot button is displayed in the statistics and visualization tabs when a <u>non-transforming</u>  search is run. </h2>

Explanation:

<h3>Transforming Search:</h3>

It can be defined as a search in which transforming commands are used that involve, charts and stats to convert data of events that is gained by the search in to tables (statistical). These tables can further be used for the basis of visualizing data in the form of charts.

Non-Transforming Search:

The search that do no contains produce event lists that can be viewed in Events tab. while using non-transforming search, i we want to generate tables or charts we must follow the points below:

  • Click ob statistics and Visualization tab.
  • Select pivot to open the search.
  • All the visualizations can be generated in this editor.

<h2>i hope it will help you!</h2>
5 0
3 years ago
Why was 1990 an important year regarding air quality?
fredd [130]

Explanation:

The United States created the Environmental Protection Agency. in some ways they have did that

4 0
3 years ago
Read 2 more answers
Write a bool function isPalindrome that takes one string parameter and returns true if that string is a palindrome and false oth
kkurt [141]

Answer:

Here is the bool function isPalindrome:

bool isPalindrome(string s)

{  bool palindrome;      

 int j;

 int len = s.length();

 for (int i =0, j= len-1; i < len/2; i++, j--)  

   if (s[i] == s[j])

     palindrome = true;  

   else

     palindrome = false;

 return palindrome; }

Explanation:

The bool function isPalindrome takes a string as parameter and returns true if the string is a palindrome or false if the string is not palindrome. The string variable s holds the string value. In function isPalindrome, there is a bool type variable palindrome. bool is a data type which is used to hold values true or false which is then stored in the palindrome variable.

Next it is being found that how many characters are there in the input string using length() function which returns the length of the string. The length of the string is stored in int type variable len.

Next the for loop starts which has two variables i and j where i starts at 0 position of the input string and j starts at the last position of the string. These two variables move or traverse along the string this way. i variable stops when half the length of the input string is reached. At the end of every iteration i moves forward by the increment of its value to 1 and j moves backwards by the decrement  of its value to 1.

Every the body of  the loop executes, there is an if condition in the body of the loop which checks if the string is a palindrome. This is checked by matching the character at position/index i with the character at position j of the string. This will continue character by character until the i reached half the length of the input string and if every character in i was matched to every character in j then palindrome = true; statement is executed which returns true as the string is a palindrome otherwise palindrome = false; is returned as the string is not a palindrome.

For taking input string from the user and to check if the function isPalindrome() works correctly a main() function is written which takes input string from the user and reads in variable str calls isPalindrome() function. If the string is palindrome then the cout statement in main() function prints the message: String is a palindrome and if the input string is not a palindrome the the following message is displayed in the output screen: String is not a palindrome

int main()

{

string str;

cout<<"Enter a string: ";

cin>>str;

if(isPalindrome(str))

cout<<"String is a palindrome";

else

cout<<"String is not a palindrome";

}

The screenshot of the program along with the output is attached.

7 0
2 years ago
After reviewing device security you learn that a malicious user in an airport
NARA [144]

Answer:

Sniffing.

Explanation:

Data theft can be defined as a cyber attack which typically involves an unauthorized access to a user's data with the sole intention to use for fraudulent purposes or illegal operations. There are several methods used by cyber criminals or hackers to obtain user data and these includes DDOS attack, SQL injection, man in the middle, phishing, sniffing, etc.

Sniffing can be defined as a form of cyber attack in which a malicious user gains access to a private network with the intent of finding out what information is stored on the network.

A packet sniffer also known as a packet analyzer, is a computer software or hardware tool that can be used to intercept, log and analyze network traffic and data that passes through a digital network.

Basically, an unauthorized packet sniffer is used to steal user informations.

This ultimately implies that, sniffing typically involves monitoring and capturing internet traffic (data packets) that are transmitted through a private network in real-time by using a sniffing tool, which may either be a hardware or software.

In this scenario, a malicious user in an airport terminal seating area was able to connect wirelessly to a traveling employee's smartphone and downloaded her contact list. Thus, the type of attack that has taken place is referred to as sniffing.

4 0
3 years ago
Other questions:
  • If you “bury” a story on Digg, what have you done
    10·1 answer
  • You can't get close enough to the facility interior to launch an evil twin attack against its wireless clients; in fact, you hav
    11·1 answer
  • Which function will add a name to a list of baseball players in Python?
    13·2 answers
  • Jared recently sent an email to all the members of his department asking them for their opinions about where the department shou
    11·1 answer
  • Sometimes we care about the order of a list, and need to reorder the items according to a condition (alphabetical, numerical, et
    11·2 answers
  • Program a substitution cipher in Python. Create 2 functions one for encryption and the other for decryption ( get the text as th
    8·1 answer
  • Decimal numbers are based on __________.
    6·1 answer
  • Patricia Works in a coffee shop and manages the inventory of items.for each item she needs to recover the quantity in stock and
    12·1 answer
  • Why are pirated software considered a threat?​
    6·1 answer
  • The _____ layer addresses how the software will execute on specific computers and networks.
    14·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!