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
What is one reason to create a study check list​
grigory [225]
To make sure you studied everything you need to know.
4 0
3 years ago
Write a C# program that prints the number of quarters, dimes, nickels, and pennies that a customer should get back as change. De
kondor19780726 [428]

Following are the code of C# to prints the number of quarters, dimes, nickels, and pennies

Program Explanation:

  • Declaration of the namespace.
  • Made a class named "Class1".
  • Declared the methods as well as the attributes.
  • Declared the main method.
  • Wrote the statements according to the given query.

Program:

using System;

using System.Collections.Generic;

using System.Linq;

using System.Text;

namespace Project1

{

   class Class1      

   {

       static void Main(string[] args)

       {

           int change = 0;

           int quart, dim, nic, pen;

           Console.WriteLine("enter amount of cents (less than 99)");

           change = int.Parse(Console.ReadLine());

           quart = change / 25; //calculate the remainder              

           int p = change % 25;

           dim = (p / 10);

           int a = p % 10;

           // Nickles

           nic = a / 5;

           int c = a % 5;

           pen = c;

           Console.Write("There are {0} quarters.\n", quart);

           Console.Write("There are {0} dimes.\n", dim);

           Console.Write("There are {0} nickels.\n", nic);

           Console.Write("There are {0} pennies.\n", pen);

           Console.ReadLine();

       }

   }

}

Output:

Please find the attachment of the output.

Learn more about C# here:

brainly.com/question/5023004

6 0
3 years ago
A technician is installing a server using a two-channel RAID controller, using RAID1 for the first channel and RAID5 for the sec
Stolb23 [73]

Answer:

Two disks RAID 1 and four disks RAID 5.

Explanation:

The RAID level stands for Redundancy array of independent disk drive level. It is a process whereby disk storage like hard disk drive or solid state disk are connected in array to function in parallel to each other, to promote performance and reliability. The categories of raid level are 0, 1, 3, 5, 10 etc.

The RAID level 1 writes data on both main disk and mirror disk. It is more efficient with only two disk. The RAID 5 strips data across disk array and stores a parity check on them. It can hold 16 disks efficient and can be used in the two channel RAID to hold the remaining four disks.

5 0
3 years ago
Which of the following terms are aspect ratios for devices? 'select all that apply
Viktor [21]

Answer:

1080 x 1920

800 x 600

Explanation:

These are the screen sizes that you can find in the list of the screen sizes, which can be easily found in the document that lists all the screen sizes. You will certainly find the 1080 x 1920 and also the 800 x 600, however, you will not find the 320 x 240 and 800 x 600. The last two are the standard screen sizes and hence are not the correct options. The correct options are as listed above.

3 0
4 years ago
Which one is exit controllefd loop ?<br>1.while loop <br>2. for loop<br>3. do loop<br>4. none <br>​
erica [24]

Answer:

2 is the ans

Explanation:

bye bye, gonna go to studyy

3 0
3 years ago
Other questions:
  • 50+ POINTS AND BRAIN IF CORRECT Chris is working with other employees on a worksheet. The other employees have made comments, bu
    8·1 answer
  • What happened to Henry at the end of Chapter 4 in Bendy and the ink machine?
    9·2 answers
  • What is the term for individual computers and devices that are connected to a network?
    14·1 answer
  • Please help!
    10·2 answers
  • Employees at a store are paid daily wages according to the following rules.
    6·1 answer
  • What are the flowchart symbols?​
    6·1 answer
  • What is generalization error in terms of the SVM? a. How accurately the SVM can predict outcomes for unseen data b. How far the
    5·1 answer
  • You use ddl to create, modify, and delete the ___________________________ of a database.
    6·1 answer
  • is there anybody out there who is a social butterfly like me? If so then you can tlk to me on this. and to anybody out there tha
    12·1 answer
  • I WILL MARK BRAINLEST
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!