Questions: 11 448

Answers by our Experts: 10 707

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Search & Filtering

Make a c++ program that will print the average of the values of an array named areas with values 84, 76, 48 using while loop.


Create a c++ program that counts and displays the odd and even numbers among the 10 input values.


Array: Use 3 separate arrays. First output displays the count and list of even and odd numbers. Next output says 'All numbers are even' and third says 'All numbers are odd'


write a c++ program that initializez 20 elements the program will ask the user to enter a number checks if it is an element in array


Input a non-zero positive integer.


Using while loop, print out each digit of the inputted integer in separate lines, starting from its rightmost digit until the leftmost digit of the number.


Tip #1: Use % 10 to get the rightmost digit. For example, if you do 412 % 10, then the result would be the rightmost digit, which is 2.


Tip #2: On the other hand, use / 10 to remove the rightmost digit. For example, if you do 412 / 10, then the result would be 41.


Tip #3: You'd have to repeat Tip #1 and Tip #2 inside the while() loop for this problem while the inputted integer is not yet 0.


Write a program using one dimensional arrays that searches a number and display the number of times it occurs on the list of 12 input values

Write a C++ program to solve the following problems (Red colour texts are to indicate user inputs that can be changed)

Out Put

    Enter your Account Number: 2000342200267

    Enter your Name: Abebe Kebede

    Enter the amount: 1000

    How long to keep it (number of month): 10

Dear Abebe Kebede

Acc: 2000342200267

After 10 Months you will get a total of 700 Birr Interest

Your Balance will be = 1700 Birr

Examine the incomplete program below. Write code that can be placed below the comment (// Write your code here) to complete the program. Use nested loops to calculate the sum and average of all scores stored in the 2-dimensional array: students so that when the program executes, the following output is displayed. Do not change any other part of the code.


OUTPUT:

Sum of all scores = 102

Average score = 17

CODE:

#include <iostream>

using namespace std;

int main()

{

  const int NUM_OF_STUDENTS = 2;

  const int NUM_OF_TESTS = 3;

  int sum = 0, average = 0;

   

  double students[NUM_OF_STUDENTS][NUM_OF_TESTS] =   

    {

      {11, 12, 13},

      {21, 22, 23}

    };

     

  // Write your code here:

   

   

   

  cout << "Sum of all scores = " << sum << endl;

  cout << "Average score = " << average << endl;

   

  return 0;

}


What is the output of each of the following statements? Assume that

x = 5, y = 2, z = 10, and temp = 0

 

6. if (x + y > z)

      x = y + z;

   else

      x = y - z;

   cout<< x << " " << y << " " << z << endl;


What is the output of each of the following statements? Assume that

x = 5, y = 2, z = 10, and temp = 0

 

 


1. if (y >= x)

      y = z;

   cout<< x << " " << y << " " << z << endl;

 

2. if (y >= x)

   {

      y = z;

      cout<< x << " " << y << " " << z << endl;

   }

 

3. if (z < y)

      temp = x;

      x = z;

   z = temp;

   cout<< x << " " << y << " " << z << endl;

 

 

4. if (z > y)

   {

      temp = x;

      x = z;

      z = temp;

   }

   cout<< x << " " << y << " " << z << endl;

 


5. if (x >= 6)

   cout<< x + y << endl;

   cout<< x + y << endl;

 

 

 

6. if (x + y > z)

      x = y + z;

   else

      x = y - z;

   cout<< x << " " << y << " " << z << endl;

 

 



Create a c++ program the counts and display the odd and even numbers among the ten input values using a two dimensional array.


First row - 10 input numbers

Second row - even numbers

Third row - odd numbers


LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS