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
A type of indent where the first line of text starts at the left margin and the second and succeeding lines of text are indented
9966 [12]

Answer: The first line intent

Explanation:

 The first line intent is one of the type of intent and the first line of the text are mainly starts from the left margin. It is one of the most common method to start the line or text with the new paragraph. We use the tab key for creating the first line indent in the word.

In the first line indent the second line are basically known as the succeeding line of the text that contain the various indented bullets.

3 0
4 years ago
Read 2 more answers
When it comes to credit scores, why is having a
inessss [21]

Answer:

credit karma

Explanation:

karma is -69

6 0
3 years ago
What is the typical relationship between time and interest rate?
prisoha [69]
The relationship between time and interest is: time allowed to repay the loan (monthly payments)
7 0
3 years ago
Apple users tend to like the company and love its products. Apple has successfully nurtured this __________ component of its cus
Nina [5.8K]

Answer:

Apple users tend to like the company and love its products. Apple has successfully nurtured this Affective component of its customers' attitudes.

Explanation:

There are three component of attitudes, they include the behavioral component, the affective component and the cognitive component.  

The affective component of attitude is concerned about the emotional response attached to an attitude.  The affective component  involves a person’s feelings / emotions about the attitude object.  i.e it is basically concerned with the emotional reaction of a person or customer to a particular object or good.  

Hence, apple users liking the company and loving its products shows that Apple has successfully nurtured the affective component of its customers' attitude.  

4 0
3 years ago
What science category includes physics and biology?
enyata [817]

Answer:

Physical science is the study of the inorganic world. That is, it does not study living things. (Those are studied in biological, or life, science.) The four main branches of physical science are astronomy, physics, chemistry, and the Earth sciences, which include meteorology and geology.

5 0
3 years ago
Other questions:
  • A set of communication rules for the computer to follow is called, what?
    10·2 answers
  • Which diagrams represent how roles can affect careers and lifestyles
    11·1 answer
  • In number theory, a perfect number is a positive integer that is equal to the sum of its proper positive divisors, that is, the
    12·1 answer
  • What is a critique of the feature detector model of object recognition?​?
    8·1 answer
  • Please help with this
    5·2 answers
  • A computer can sort x objects in t seconds, as modeled by the function below:
    5·1 answer
  • Swiping up with three fingers on mac os x launches what?
    8·1 answer
  • ) Doyou know applets and Java Beans in Java? Please briefly state eachone with an example.
    10·1 answer
  • I ONLY HAVE 5 MIN HELPPPPPP
    15·2 answers
  • 1. Write an if statement that assigns 20 to the variable y, and assigns 40 to the variable z
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!