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
Catastrophic injuries and illnesses account for two-thirds of total health care costs in the country of Gnut. The Gnuti governme
Vilka [71]

Answer:

In the country of Gnut

The universal health insurance program that is likely to better allow Gnuti citizens to smooth consumption is:

program Y that would pay only for catastrophic illnesses and injuries.

Explanation:

Program Y is a better option for Gnuti citizens to smooth consumption.  The reason is that catastrophic injuries and illnesses already account for two-thirds of the total health care costs in the country.  These injuries and illnesses cost more income variability to the citizens than other health care expenses.  With the government sponsoring program Y, the citizens will be insulated from consumption patterns caused by income variability.  Consumption smoothing creates the needed balance between spending and saving during the different life phases for the citizens of Gnut.

3 0
3 years ago
sometimes people who have been playing gta for a while are annoying, i was playing gta this weekend and was trying to escape, bu
murzikaleks [220]
Yeah I stopped playing cause of people like that, I’m sorry you had to deal w that op :) I hope you have a nice day
3 0
3 years ago
Read 2 more answers
Why is art important to heritage?
Sophie [7]
<span>but of culture, values and traditions. Cultura</span>
7 0
3 years ago
What's the function of a cyclebin​
amid [387]

Answer:

In Windows, the Recycle Bin is a folder or directory where deleted items are temporarily stored. Deleted files are not permanently removed from the hard drive but are sent instead to the Recycle Bin, unless they are too large.

3 0
3 years ago
One or more access points positioned on a ceiling, wall, or other strategic spot in a public place to provide maximum wireless c
Lera25 [3.4K]

Answer:

hotspots.

Explanation:

Hotspots is a small geographical location with at least one access point in an outdoor/indoor setting, that provide people with maximum wireless coverage within that area and its mostly uses a wireless local-area network (WLAN) using a router to connect to an Internet service provider.

7 0
3 years ago
Other questions:
  • Walt needs to ensure that messages from a colleague in another organization are never incorrectly identified as spam. What shoul
    14·2 answers
  • Create a test that prompts a user to enter a 5-digit PIN in the main procedure and then calls Validate PIN procedure to validate
    12·1 answer
  • Write a program which reads in a single integer 0 &lt;= n &lt; 30 and prints out the factorial of n. Factorials get very big ver
    9·2 answers
  • Cabe participates in her employer’s PPO plan. Denzel participates in her employer’s HDHP plan. Neither have any medical expenses
    11·2 answers
  • Piers wants to take a course on XML. He is a certified web designer, but he has not used XML before. How can he use XML to impro
    6·1 answer
  • What is the difference between a crosstab query and a subquery?
    11·2 answers
  • how is a two-dimensional array different from a traditional one dimensional array? From an ArrayList?
    6·1 answer
  • With social media presence growing why is cyberbullying at an all time high
    8·2 answers
  • It is recommended that systems administrators analyze logs in order to determine if they have been altered because monitoring ca
    14·1 answer
  • An international pharmaceutical company is fully compliant with local and international regulations. However, they suffered a ma
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!