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
IrinaK [193]
3 years ago
11

cout << "Part 1" << endl; // Part 1 // Enter the statement to print the numbers in index 4 and index 9 // put a spac

e in between the two numbers cout << endl; // Enter the statement to print the numbers 3 and 80 from the array above // put a space in between the two numbers cout << endl; // Enter the statement to change the number 1 in the array to be 12 // then write the statement to print out that number in the array cout << "\nPart 2" << endl; // Part 2 // Write a function called printAll. It takes in an array // and an integer that has the number of values in the array. // The function should print all the numbers in the array with // a space between each one. // Call the function on the line below. cout << "\nPart 3" << endl; // Part 3 // Write a function called printEven. It takes in an array and // an integer that has the number of values in the array. It prints // all the even numbers in the array with a space between each one. // This function returns the count of evens. int evens; // Call the function you just wrote and store the // answer in the variable evens declared above.
Computers and Technology
1 answer:
Margarita [4]3 years ago
3 0

Answer and Explanation:

#include <iostream>

using namespace std;

int printEven(int array[],int n)

{

int count=0;

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

{

if(array[i]%2==0)

{

count++;

cout<<array[i]<<" ";

}

}

return count;

}

void printAll(int array[],int n)

{

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

{

cout<<array[i]<<" ";

}

}

int computeTotalOdds(int array[],int n)

{

int count=0;

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

{

if(array[i]%2!=0)

{

count++;

 

}

}

return count;

}

int main()

{

int array1[20] = {3, 18, 1, 25, 4, 7, 30, 9, 80, 16, 17};

int numElements = 11;

cout << "Part 1" << endl;

cout<<array1[4]<<" "<<array1[9];

cout << endl;

cout<<array1[0]<<" "<<array1[8];

cout << endl;

array1[2]=12;

cout << "\nPart 2" << endl;

printAll(array1,numElements);

 

cout << "\nPart 3" << endl;

int evens;

evens=printEven(array1,numElements);

 

 

 

 

// This will print the number of evens in the array.

cout << endl << evens;

 

cout << "\nPart 4" << endl;

 

int total;

 

total=computeTotalOdds(array1,numElements);

cout << endl << total;

 

return 0;

}

You might be interested in
Think of a genre (science, music, math, sports, video games, etc.) and create at least 10 questions. You can decide whether you
mojhsa [17]

<em>Answer:</em>

<em>When listing to studying music or calm music it will help you considerate on a test or any home work that you are doing </em>

<em>Explanation:</em>

<em>Since 2006, two UCF professors neuroscientist Kiminobu Sugaya and world-renowned violinist Ayako Yonetani have been teaching one of the most popular courses in The Burnett Honors College. “Music and the Brain” explores how music impacts brain function and human behavior, including by reducing stress, pain and symptoms of depression as well as improving cognitive and motor skills, spatial-temporal learning and neurogenesis, which is the brain’s ability to produce neurons. Sugaya and Yonetani teach how people with neurodegenerative diseases such as Alzheimer’s and Parkinson’s also respond positively to music. </em>

<em> </em>

<em>“Usually in the late stages, Alzheimer’s patients are unresponsive,” Sugaya says. “But once you put in the headphones that play [their favorite] music, their eyes light up. They start moving and sometimes singing. The effect lasts maybe 10 minutes or so even after you turn off the music.” </em>

<em> </em>

<em>This can be seen on an MRI, where “lots of different parts of the brain light up,” he says. We sat down with the professors, who are also husband and wife, and asked them to explain which parts of the brain are activated by music.</em>

7 0
3 years ago
What is a partition gap, and how might it be used to hide data?â?
o-na [289]
Partition is a logical drive.  Large disks have to be partitioned in order to be structured. Knowing what partition is, partition gap refers to the unused space between partitions. It is also "Inter-partition<span> space" which</span><span> can be used to hide data on a hard disk. In this case a disk editor utility is used to access the hidden data in the partition gap.</span>
4 0
3 years ago
Read 2 more answers
1. Describe a system that would be dangerous if resistance were not a part of the circuit
Ivahew [28]
A bomb system. That might be pretty dangerous
5 0
3 years ago
Read 2 more answers
Brainliest
alekssr [168]

Answer:

fair credit reporting act

6 0
3 years ago
Write one for loop to print out each element of the list several things. then write another for loop
Kay [80]

Question:

Write one for loop to print out each element of the list several_things. Then, write another for loop to print out the TYPE of each element of the list several_things.

Answer:

The solution in python is as follows:

for element in several_things:

    print(element)

   

for element in several_things:

    print(type(element))

Explanation:

The solution assumes that the list several_things has already been initialized.

So, the rest of the code is explained as follows:

This line iterates through the list, several_things

for element in several_things:

This line prints each element

    print(element)

This line iterates through the list, several_things for the second time    

for element in several_things:

This line prints the type of each element

    print(type(element))

6 0
3 years ago
Other questions:
  • A device that produces a permanent human-readable text of graphic document.
    15·1 answer
  • How can investors receive compounding returns
    13·1 answer
  • Program for bit stuffing...?
    9·1 answer
  • “You have been blocked”
    5·2 answers
  • What does the following code segment do?
    13·1 answer
  • James would like to send a document he has saved on the hard drive to coworkers in Ireland, Brazil, and India. These coworkers h
    6·2 answers
  • Which of the following are advantages of a local area network, as opposed to a wide area network? Select 3 options.
    8·1 answer
  • Which of the following is an example of metadata about a webpage?
    7·2 answers
  • Adios brainly, you were sh.t sometimes, but you had your moments, wont be posting that much take my points away i d c
    6·2 answers
  • What rpm command can be used to list the full paths for files within the bash package?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!