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
kozerog [31]
3 years ago
8

In every programming language, when you access data stored in an array, you must use a ____ containing a value that accesses mem

ory occupied by the array.
Computers and Technology
1 answer:
Mariulka [41]3 years ago
4 0
An array is an indexed collection of data elements. First you must declare an array, give its name and data. <span>Once your arrays are declared, you access the elements in an array with the array name, and the index number inside brackets [ ].
So, in every </span><span>programming language, when you access data stored in an array, you must use a command [] (brackets) containing a value that accesses memory occupied by the array.</span>
You might be interested in
Design a for loop that gets 6 integer numbers from a user, accumulates the total of them, then displays the accumulated total to
PSYCHO15rus [73]

Answer:

Explanation:

The following loop code is written in Java and asks the user for the 6 integer numbers as mentioned in the question and sums them up. Finally putting them into a variable named total and printing it out.

       int total = 0;

       for (int x = 0; x < 6; x++) {

           Scanner in = new Scanner(System.in);

           System.out.println("Enter an integer: ");

           total += in.nextInt();

       }

       System.out.println("Your total is: " + total);

6 0
3 years ago
A computer _________ is a set of self-replicating program instructions that surreptitiously attaches itself to a legitimate exec
k0ka [10]
Virus                    <span> </span>
4 0
4 years ago
Print 1 to 100 in visual basic .6
FrozenT [24]

Answer:

make ( next i ) after ( debug. print ) ​

Explanation:

Its definitely, the above answer. DIM is used for defining a variable which is an integer here. Then the for loop has been used and this will run for 1 to 100 thus as we move under debug,print I. But Next I should come after. Hence first it will be Debug,print I and then the next I .

And hence, the above answer.

The full program will be:

SUB MAIN()

DIM I AS INTEGER

FOR I = 1 TO 100 STEP 1

DEBUG.PRINT I

NEXT I

END SUB

6 0
3 years ago
Write a program that prints the following text: In C, lowercase letters are significant. main() is where program execution begin
hodyreva [135]

Answer:

Program:

#include <stdio.h> // header file

int main() // main function

{

   printf("In C, lowercase letters are significant. main() is where program execution begins. Opening and closing braces enclose program statements in a routine. All program statements must be terminated by a semicolon."); // print statement which print the text which is said by the question to print.

return 0; // return statement

}

Output:

  • The above code print the text which is defined by the question to print

Explanation:

  • The above code is in the c programming language.
  • The first line of the code is a header file which is used to specify the meaning of the symbols used in programs.
  • The second line of the code is the main function, from which the execution will starts.
  • The third line of the code is the print statement which prints the above text.
  • The fourth line of the code is a returned statement that returned 0 from where the function is called.
7 0
3 years ago
Write a program to read as many test scores as the user wants from the keyboard (assuming at most 50 scores). Print the scores i
Oksana_A [137]

Answer: Provided in the explanation segment

Explanation:

Below is the code to carry out this program;

/* C++ program helps prompts user to enter the size of the array. To display the array elements, sorts the data from highest to lowest, print the lowest, highest and average value. */

//main.cpp

//include header files

#include<iostream>

#include<iomanip>

using namespace std;

//function prototypes

void displayArray(int arr[], int size);

void selectionSort(int arr[], int size);

int findMax(int arr[], int size);

int findMin(int arr[], int size);

double findAvg(int arr[], int size) ;

//main function

int main()

{

  const int max=50;

  int size;

  int data[max];

  cout<<"Enter # of scores :";

  //Read size

  cin>>size;

  /*Read user data values from user*/

  for(int index=0;index<size;index++)

  {

      cout<<"Score ["<<(index+1)<<"]: ";

      cin>>data[index];

  }

  cout<<"(1) original order"<<endl;

  displayArray(data,size);

  cout<<"(2) sorted from high to low"<<endl;

  selectionSort(data,size);

  displayArray(data,size);

  cout<<"(3) Highest score : ";

  cout<<findMax(data,size)<<endl;

  cout<<"(4) Lowest score : ";

  cout<<findMin(data,size)<<endl;

  cout<<"(5) Lowest scoreAverage score : ";

  cout<<findAvg(data,size)<<endl;

  //pause program on console output

  system("pause");

  return 0;

}

 

/*Function findAvg that takes array and size and returns the average of the array.*/

double findAvg(int arr[], int size)

{

  double total=0;

  for(int index=0;index<size;index++)

  {

      total=total+arr[index];

  }

  return total/size;

}

/*Function that sorts the array from high to low order*/

void selectionSort(int arr[], int size)

{

  int n = size;

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

  {

      int minIndex = i;

      for (int j = i+1; j < n; j++)

          if (arr[j] > arr[minIndex])

              minIndex = j;

      int temp = arr[minIndex];

      arr[minIndex] = arr[i];

      arr[i] = temp;

  }

}

/*Function that display the array values */

void displayArray(int arr[], int size)

{

  for(int index=0;index<size;index++)

  {

      cout<<setw(4)<<arr[index];

  }

  cout<<endl;

}

/*Function that finds the maximum array elements */

int findMax(int arr[], int size)

{

  int max=arr[0];

  for(int index=1;index<size;index++)

      if(arr[index]>max)

          max=arr[index];

  return max;

}

/*Function that finds the minimum array elements */

int findMin(int arr[], int size)

{

  int min=arr[0];

  for(int index=1;index<size;index++)

      if(arr[index]<min)

          min=arr[index];

  return min;

}

cheers i hope this help!!!

8 0
3 years ago
Other questions:
  • What is TCP/IP?
    13·1 answer
  • What is the average reading rate for middle school students?
    12·1 answer
  • create a 3 to 5 step plan for checking out a post on social media for the next time you encounter something questionable.
    11·2 answers
  • What is the full form of RAM. ​
    5·2 answers
  • An example of a ______ in the United States are computer hackers, whose members engage in actions that subvert authority, disrup
    6·1 answer
  • What breakthrough in sound recording facilitated stereophonic recording? Ο Α. overdubbing O B. multitrack recording O C. digital
    10·1 answer
  • What are the ways to search out a number from a tree?
    11·1 answer
  • Which among the following if absent, a computer is not complete.
    6·2 answers
  • 3. When code tracing, why is it important to iteratively test parts of the program?
    8·1 answer
  • The area of ai that investigates methods of facilitating communication between computers and people is?.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!