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
Answer if you play PS4 apex legends if you do answer username and first to answer is brainliest
Vinil7 [7]

Answer:

I do not, sorry

Explanation:

3 0
3 years ago
Read 2 more answers
Which microsoft operating system started the process of authenticating users with a user name and password?
11111nata11111 [884]
It should be either windows 98 or windows xp but I think it is windows xp
5 0
3 years ago
Write a piece of code that constructs a jagged two-dimensional array of integers named jagged with five rows and an increasing n
Ksivusya [100]

Answer:

Explanation:

The following code is written in Java and it uses nested for loops to create the array elements and then the same for loops in order to print out the elements in a pyramid-like format as shown in the question. The output of the code can be seen in the attached image below.

class Brainly {

   public static void main(String[] args) {

       int jagged[][] = new int[5][];

       int element = 1;

       for(int i=0; i<5; i++){

           jagged[i] = new int[i+1]; // creating number of columns based on current value

           for(int x = 0; x < jagged[i].length; x++) {

               jagged[i][x] = element;

               element += 1;

           }

       }

       System.out.println("Jagged Array elements are: ");

       for ( int[] x : jagged) {

           for (int y : x) {

               System.out.print(y + " ");

           }

           System.out.println(' ');

       }

       }

   }

4 0
3 years ago
On average, someone with a Bachelor's degree is estimated to earn ____ times more than someone with a high school diploma.
oee [108]
The correct answer is <span>B)</span> 1.4

It can be difficult to become a high earner in the U.S without a college degree. Those with a high school diploma or less are the lowest earners on average. According to research, average yearly earnings for someone with a bachelor’s degree are $59,124 as compared to someone with a high school diploma who earns an average of $35,256 per year. Thus, at the end of the day, the amount of money does become significant.



5 0
3 years ago
A(n) ____ algorithm is a set of specific, sequential steps that describe in natural language exactly what a computer program mus
Paul [167]
<span>The answer is algorithm, because computer programmers need a programming language that's more similar to their native language. They then write specific steps a computer must take to complete the task at hand. Machine code is not easily memorized and is foreign to most people.</span>
8 0
3 years ago
Other questions:
  • To ease giving access to network resources for employees, you decide there must be an easier way than granting users individual
    9·1 answer
  • On what basis can you categorize the generations of computers?
    5·1 answer
  • PLZ HELP ME I WILL GIVE BRAINLIST!!! Why was the Internet originally constructed?
    12·1 answer
  • Which term collectively describes hard disks, CDs, and flash drives?
    11·2 answers
  • Lamp is an acronym for a complete solution of open source software that goes together to build a general purpose web server. whi
    13·1 answer
  • What do you think is the most fascinating aspect of the internet?
    7·2 answers
  • National ISPs usually offer fewer services and have a smaller technical support staff than regional ISPs.
    13·1 answer
  • Personal statements School leaver
    15·1 answer
  • What is the biggest difference between a movie and a game?
    12·1 answer
  • How to transfer polygon from eth to polygon in ledger live
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!