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]
2 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]2 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
Badin Industries runs a web application that processes e-commerce orders and handles credit card transactions. As such, it is su
Novay_Z [31]

Answer:

The correct option is C.

Explanation:

As Badin Industry is using the Payment Card Industry Data Security Standard (PCI DSS) which required the scan to be be done at least annually if there is no change in the application and when the application is changed.

In this context, provided there is no application change the minimum requirement for the scan is once in the year thus the correct option is C.

7 0
3 years ago
Read 2 more answers
Rewrite this if/else if code segment into a switch statement int num = 0; int a = 10, b = 20, c = 20, d = 30, x = 40; if (num &g
Tanya [424]

Answer:

public class SwitchCase {

   public static void main(String[] args) {

       int num = 0;

       int a = 10, b = 20, c = 20, d = 30, x = 40;

       switch (num){

           case 102: a += 1;

           case 103: a += 1;

           case 104: a += 1;

           case 105: a += 1;

           break;

           case 208: b += 1; x = 8;

           break;

           case 209: c = c * 3;

           case 210: c = c * 3;

           break;

           default: d += 1004;

       }

   }

}

Explanation:

  • Given above is the equivalent code using Switch case in Java
  • The switch case test multiple levels of conditions and can easily replace the uses of several if....elseif.....else statements.
  • When using a switch, each condition is treated as a separate case followed by a full colon and the the statement to execute if the case is true.
  • The default statement handles the final else when all the other coditions are false
3 0
3 years ago
What is an example of constructive criticism for an employee who frequently arrives late?
aleksley [76]
I believe the correct answer is A
5 0
3 years ago
Read 2 more answers
Which feature of virtualisation helps increase the IT productivity of a business
PIT_PIT [208]

Answer:

Add, remove, organize and reorder commands on the Quick Access Toolbar. ... The Quick Access Toolbar is a customizable toolbar that contains a set of ... The only way to increase the size of the buttons is to lower the screen resolution you use. ... However, you can Customize the ribbon in Office to personalize the ribbon ...

Explanation:

because

8 0
3 years ago
What is the function of ctrl+Q​
vlabodo [156]

Answer:

Ctrl+Q is used to remove a paragraph's formatting

Explanation:

Hope that's the answer you're looking for!

5 0
2 years ago
Other questions:
  • Which of the following was one of the first internet search engines? A. archie B. google C. Yahoo D.ask
    7·1 answer
  • Pressing the e key while in edit mode will exit the interaction mode<br><br> true<br><br> false
    7·1 answer
  • ____ is the only automated disk-to-disk tool that allows you to copy data to a slightly smaller target drive than the original s
    5·1 answer
  • Suppose you're currently completing an examination online. When you're finished, you click on Reset Exam. Why would you do this?
    8·1 answer
  • Write a program that takes a decimal number from the user and then prints the integer part and the decimal part separately. For
    13·1 answer
  • What is the main difference between a search engine and a web browser?
    6·2 answers
  • Yeah help me please......................
    9·1 answer
  • Braxton is writing a program to design t-shirts. Which of the following correctly sets an attribute for color?
    7·1 answer
  • Perceptron simplest definition
    14·1 answer
  • If you do not clean your hardware on a regular basis, which of these is most likely to be a problem?
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!