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
Brrunno [24]
3 years ago
7

Write your own printArray() function found in Processing for the Arduino. For simplicity, you can limit printArray() to integer

arrays and you will also pass the size of the array to your function. For example, given the following code:
int terps[5] = {7, 9, 12, 1, 46};
void printArray(int arrayToPrint[], int arraySize) { // YOUR CODE HERE }
void setup()
{ // put your setup code here, to run once:
Serial.begin(9600);
}
void loop() {
// put your main code here, to run repeatedly:
printArray(terps,sizeof(terps)/sizeof(int)); delay(1000);
}

You should repeatedly see the following in the serial monitor:

[0]: 7
[1]: 9
[2]: 12
[3]: 1
[4]: 46
Computers and Technology
1 answer:
VLD [36.1K]3 years ago
6 0

Answer:

Follows are the method definition to this question:

void printArray(int arrayToPrint[], int arraySize) //defining a method printArray that accepts two array in its parameters

{

for (int j = 0; j < arraySize; j++)//defining for loop print Serial numbers

{

Serial.print("[");//use print method to print square bracket

Serial.print(j);//use print method to print Serial numbers

Serial.print("]: ");//use print method to print square bracket

Serial.println(arrayToPrint[j]);//printing array value

}

}

Explanation:

In the above code, a method "printArray" is declared that holds two arrays "arrayToPrint and arraySize" as a parameter, and inside the method is used for loop to print the values.

In the loop, first, it uses the square bracket to print the serial number and in the last step, it prints array values.

You might be interested in
What is the disadvantage of a series circuit? A. The lights in a series circuit shine too brightly B. A series circuit can have
zhuklara [117]
The answer is B or C
4 0
3 years ago
Declare an array named a of 10 elements of type int and initialize the elements (starting with the first) to the values 10, 20,
kherson [118]

Answer:

int a[10] = {10,20,30,40,50,60,70,80,90,100};

Explanation:

In the above statement, we declare the integer data type array variable that is 'a' then, pass its index value that is 10 which means it contains only 10 values and initialize the components of the array variable that is starting with 10 and end at 100 in the difference of 10. So, the following declaration is correct according to the statement.

5 0
3 years ago
Consider the following definition of a recursive method. public static int mystery(int[] list, int first, int last) { if (first
ozzi

Answer:

c. 27

Explanation:

  • In recursion method, a method calls itself until a condition becomes true and returned back. In mystery(), at first time, first is 0 and last is 4. Condition is checked and 0!=4 so else part is executed in which again mystery is called with first as 1 and last 4. This will go again and again until first=4.
  • When first=4 it is also equal to last so if part is executed and alpha[4] is returned which is 9, now it comes alpha[3] +9 which is 8+9 =17 .
  • It is returning values to its previous calls that is why it will reduce to alpha[0]+alpha[1]+alpha[2]+17 which is nothing but sum of all elements of a alpha
  • Then, 1+4+5+8+9=27.
5 0
3 years ago
What are 3 things that can make cyberbullying especially harmful​
motikmotik

Answer:

Anxiousness and depression

Suicidal Thoughts

Anger

Explanation:

Three major side affects of cyber bullying are

  1. Anxiousness and depression
  2. Suicidal Thoughts
  3. Anger

Anxiousness and depression

Cyber bullying takes away self esteem and self confidence.Lack of self esteem makes person to feel bad about him/her self and lack of confidence makes taking daily life decision very difficult which all adds up to stress

Anger

Some people might feel powerless while others strike back on the bullies in anger.Unchecked anger can be very dangerous.Burning in the flames of anger a person will plot revenge and can go to any means for this. This starts a never ending bully-victim cycle

Suicidal Thoughts

Depression if not cured can lead to suicidal thoughts. When a person is felling low and have no self confidence death seems an easy way out.

3 0
3 years ago
3 examples of operating systems ​
Citrus2011 [14]

Answer:

Linux, Windows, Macintosh

Explanation:

8 0
3 years ago
Other questions:
  • Format Painter cannot be used to copy only character attributes. True or False
    12·1 answer
  • What is working with others to find a mutually agreeable outcome?
    6·1 answer
  • A bin contains 100 sty le a notebooks, 100 style b notebooks, and 100 style c notebooks. antoine will select 3 notebooks from th
    9·1 answer
  • The main benefit of encryption of a hard drive is to make part of an ROI report.
    15·1 answer
  • When programming in Scratch, to make our Sprite walk across the background, in which category would we find the programming bloc
    7·1 answer
  • Which building-block feature is available in the Text grouping on the Insert tab?
    14·1 answer
  • Some classes, like the ArrayList class, use angle brackets in their documentation and their declaration. For example, the Java d
    5·1 answer
  • What does Data storage enable a browser to do
    5·1 answer
  • Create the following new exceptions: PokemonException, which extends the Exception class. It must have a no-parameter constructo
    13·1 answer
  • Represent the measuring unit ofcomputer un terms of fration of second​
    13·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!