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]
2 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]2 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
A more efficient design which involves the logical separation of a switch ports into different broadcast domains is known as a _
Nataly [62]

Answer: Virtual local-area network (VLAN)

Explanation:Virtual LAN(local area network) is the network that works on the particular geographical environment/domain in separative way by pretending to be working in the same local area.

This network works to maintain the security and network management in the geographical area .It is implement to gain the scalability and adaptability to the changes occurring in the network.

3 0
3 years ago
Wats is a internal disk drive​
NikAS [45]

Answer: Internal disk drive is the main storage device located in a computer. It usually contains software applications, the operating system and other files.

Explanation:

3 0
3 years ago
Read 2 more answers
What is token passing?
Flauer [41]

Answer:

Answer is A network access method that avoids the possibility of data collisions.

Token Ring is the precursor to Ethernet and CSMA/CD to avoid packet collisions.

Explanation:

8 0
3 years ago
Huzaifa is a grade 5 student who is very enthusiastic to learn coding in computers. He asks his computer teacher to help him cho
GaryK [48]

Answer:

High level language.

Explanation:

High level language can be defined as a programming language which is generally less complex than a machine (low level) language and easy to understand by the end users (programmers).

This ultimately implies that, a high level programming language is typically a user friendly language and as such simplifies coding or programming for beginners.

Some examples of high level programming language are Python, Java, C#, Ruby, Perl, Visual Basic, PHP, Cobol, C++, Fortran, Javascript, etc.

In this scenario, Huzaifa is a grade 5 student who is very enthusiastic to learn coding in computers. He asks his computer teacher to help him choose a language to code. Thus, the language level the teacher will recommend to Huzaifa is a high level language.

3 0
3 years ago
¿los equipos de computo pueden ser vulnerables?
ss7ja [257]

Answer:

Si puede

Explanation: Yes it can

6 0
3 years ago
Other questions:
  • ​A(n) ____ statement can include rules for site visitors, a statement of copyright in the site design and content, and can restr
    12·1 answer
  • Given a int variable named yesCount and another int variable named noCount and a char variable named response, write the necessa
    9·1 answer
  • Soo...My Old 3DS XL haven't been touched in around a year...So i tried to charge it but no LED lights opened..Even the power but
    14·1 answer
  • Which options are available in the Conditional Formatting dialog box? Check all that apply.
    15·2 answers
  • Network Architecture and Topology: Mastery Test
    15·1 answer
  • Which careers have the highest minimum experience requirement?
    14·1 answer
  • Courses that enable students to begin jobs that require course completion certificates are know as
    8·1 answer
  • Jonah wants to type an assignment using Word. Arrange the steps he needs to follow in the correct order.?
    13·1 answer
  • Golf scores record the number of strokes used to get the ball in the hole. The expected number of strokes varies from hole to ho
    5·1 answer
  • What does it mean "Be Proactive"?
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!