In C++ Language: Write a function SummOdd that will find the sum of all elements of add order a1+ a3+... of a given array. Pass an array arr[] and a dimension n and return the value of the sum a1+ a3+...  as the function's return value. Call this function in the main() with arr[] = { 8,6,4,2,3,5} and dimension n=6 to test the correctness of your general function.  Keywords: Write function, pass array and dimension, return sum of odd order

Question

In C++ Language:

Write a function SummOdd that will find the sum of all elements of add order a1+ a3+... of a given array. Pass an array arr[] and a dimension n and return the value of the sum a1+ a3+...  as the function's return value. Call this function in the main() with

arr[] = { 8,6,4,2,3,5} and dimension n=6 to test the correctness of your general function. 

Keywords: Write function, pass array and dimension, return sum of odd order 

Expert Answer

Want to see the step-by-step answer?

Check out a sample Q&A here.

Want to see this answer and more?

Experts are waiting 24/7 to provide step-by-step solutions in as fast as 30 minutes!*

*Response times may vary by subject and question complexity. Median response time is 34 minutes for paid subscribers and may be longer for promotional offers.
Tagged in
Engineering
Computer Science

Related Computer Science Q&A

Find answers to questions asked by students like you.

Q: A list named theLst has six string values. Append "hi" to the value in first element of the list.

A: As you have not specified the programming language, we have solved this question using Python progra...

Q: Use the Design Recipe to write a function called running_average that repeatedly asks the user to in...

A: DESIGN RECIPE:Based on the given problem use meaningful variable and function name. And perform the ...

Q: 3. Use a trace table to show what is the output of the following program? #include using namespace ...

A: As per the policy we are required to answer only one question.Solution for question 3 is as follows:...

Q: Design a reasonably efficient algorithm for solving each of the following problems and determine its...

A: AlgorithmLet x be one of the numbers and the other number is n-x. The first step is to maximize f(x)...

Q: Write a program Gas.java that computes and displays the price a person will pay for gas at the gas s...

A: public class Gas {      public static void main(String[] args)       {             if (args.length &...

Q: Hi, I have to display the first 20 Fibonacci numbers to the console. The first two numbers are given...

A: Program: class PrSpecial { public static final int N = 20; public static void main(String[] args){ i...

Q: Using DeMorgan's Law, write an expression for the complement of F if F(x,y,z) = xz' (xy + xz)+ xy'(w...

A: Demorgan’s law is a transformation rule in Boolean algebra. According to this rule,Negation of A OR ...

Q: Use the pumping lemma to show that the following set is NOT regular: {ww | w => {a,b}*}

A: Pumping Lemma:We can prove this by using pumping lemma which states that L is a regular language if ...

Q: Suppose you have two tables: EMPLOYEE and EMPLOYEE_1. The EMPLOYEE table contains the records for th...

A: To display the output of the given tables by using UNION operator.Two tables are given:First Table n...

Q: I am having trouble writing a python program that opens a file that contains baby names. One file fo...

A: To run this code, make all the files Boys.txt, Girls.txt and .py files in same folder.input() is use...

Q: Why does the order of the operands (tables) matter in an EXCEPT (MINUS) query but not in a UNION que...

A: MINUSMINUS operator is used for getting the result that is present in the first table but not in the...

Q: Create a time conversion program that prompts the user for a time in minutes. The program will conve...

A: Create a C++ program and inside the main method declare all required variables. And then take input ...

Q: What are the differences between the top-down and bottom-up approaches to information security? Why ...

A: Top-down approach:Top-down approach is the division of system into subsystems which are done to gain...

Q: 6. How many times will the following nested for loops execute and what is the output? for (i 1; i<5;...

A: For loop:For loop is repeatedly used to perform a series of statements until the fulfilment of a con...

Q: While attempting to connect to the wireless network at your job, you notice that five different wire...

A: Wireless network:It is a network which is used to communicate among computer systems and other netwo...

Q: PLEASE EXPLAIN ALL STEPSIn the following code, determine the value of the symbole this. Predict and ...

A: Explanation of given code:“this” is a variable.DECO this, d; The instruction DECO means Decimal outp...

Q: I need some help arranging these countries in a C++ program : China: 1,433,783,686 India: 1,366,417,...

A: Program AlgorithmDeclare two arrays named country and population of size 14.Using for loop enter the...

Q: Then create a new Java application called "Rooter" (without the quotation marks) that does the follo...

A: This JAVA program accepts a positive integer as input and gives the square root up to 4 places of in...

Q: What is the most trending programing Interface and language for develpors in world's sofftware house...

A: Most Trending Programming Language: In the world, where everything is shifting from analog to digita...

Q: PLEASE EXPLAIN ALL STEPSCreate a truth table of the equation:((((Y AND (NOT Z)) OR ((NOT Y) AND Z)) ...

A: Note: In the given equation, the number of opening and closing brackets is not equal. The following ...

Q: Use the Design Recipe to define a function remove_value that consumes a list and a value and returns...

A: Program: def remove_value(list, value):result = []for number inlist:if number != value:result.append...

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: The name of the program is CharCounter.inputEntry is a string type variable and used for storing use...

Q: c++ program to read file and output grades - file name is studentGrades.txt and the content is inclu...

A: Program Instructions:Comment the unused code and add necessary variables.Use a while and three inner...

Q: what is mantissa and exponent values of 6.75

A: Convert decimal number (6.25)10 to binary:First, convert integer value (6)10 to binary:To obtain bin...

Q: what is a loop

A: DefinitionIn programming languages, a loop is an arrangement of commands that is frequently repeated...

Q: Convert the following machine language instructions into assembly language, EXPLAIN ALL STEPS, assum...

A: 82B7DE:The given machine language instruction is 82B7DE.Its equivalent binary representation is 1000...

Q: Write a program in Java that prompts the user for the number of pennies, nickels, dimes and quarters...

A: A Java program is to be written that would take the values of pennies, nickels, dimes and quarters a...

Q: Evaluate cloud computing in relation to each of these four (4) criteria Dependable Manageable Adapta...

A: DescriptionEvaluating cloud computing in relation to the following four criteria’s:DependableDependa...

Q: In MS Access, to ensure that a promised date valued entered must a future point in time, whichvalida...

A: Now() function:The Now() function in Microsoft Access is used to return current date and time based ...

Q: Create a method multiply(), that receives the 2D array you created in the program below as as an inp...

A: Create a public static type of method with a void return type and from the main method that method w...

Q: C++    Write a recursive program that finds out if n is a Fibonacci number or not. The Fibonacci num...

A: The C++ program will follow the given rubrics:Importing header files.Displaying the message to user ...

Q: Question 3: Declare a vector with... a) An empty vector holding int elements b) A vector with size 3...

A:  Declaring the vector:a) Empty vector holding “int” elements:vector&lt;int&gt; intVector;Here, “intV...

Q: Algorithm problem w/ recurrence: Frying pancakes: a small pan can only hold two pancakes at a time. ...

A: Let T(n) be the time required to fry n pancakes on both the sides.Given condition:If n=1, time requi...

Q: WHY THE BLOCKCHAIN  TECHNOLOGY IS SAID TO HAVE POTENTIAL FOR BUSINESS AND ORGANIZATIONS?

A: After the creation of the internet, cryptocurrencies and their underlying blockchain technology are ...

Q: For any element in keysList with a value greater than 100, print the corresponding value in itemsLis...

A: The given elements of keysList is {42, 105, 101, 100}And the given elements of itemsList is {10, 20,...

Q: Describe a cloud storage application and explain the advantages and disadvantages of such cloud stor...

A: Cloud storage:Cloud Storage is a service where data is remotely maintained, managed, and backed up. ...

Q: In python I have  N unique coupons that are included in boxes of the cereal being sold. A consumer w...

A: All the lines included after the #(hash) are python comments.To print the N unique coupons:for loop ...

Q: I dont understand how theyre getting the answers to the output public class MysteryWho {public stati...

A: The output of the given program is:

Q: I need some help arranging these countries in a C++ program : China: 1,433,783,686 India: 1,366,417,...

A: Program Instructions:Declare two arrays and store values of countries and populations in each of the...

Q: Identify where magnetic tape is still in use and explain why.

A: Use of Magnetic Tapes:Invented in 1928 for the purpose of sound recording.Reliable data storage sinc...

Q: Replace any alphabetic character with '_' in 2-character string passCode. Ex: If passCode is "9a", o...

A: program to replace first 2-character by ‘_’ from the passcode.isapha() function is used for finding ...

Q: First, launch NetBeans and close any previous projects that may be open (at the top menu go to File ...

A: Launch the NetBeans IDE.

Q: what are the mantissa and exponent values if 6.75 is represented in 8-bit binary floating point repr...

A: Conversion of decimal to 8-bit floating point representation:Step 1: Convert the integer part of the...

Q: Siobhan’s laptop has 8GB of RAM. Her operating system takes up 2GB, and her application programs use...

A: Random Access Memory (RAM):RAM is a memory device used for storage purposes.The data stored in the m...

Q: Vectors Write three statements to print the first three elements of vector runTimes. Follow each wit...

A: Program DescriptionThe program prompts the user to input 5 numbers to populate the vectorIt tests th...

Q: Use the Design Recipe to write a function called my_sum  that consumes one parameter, assumed to be ...

A: The python program obeys the following rubrics:Defining a function my_sum which accepts a parameter,...

Q: 4.7: Time Machine Your time machine is capable of going forward in time up to 24 hours. The machine ...

A: Following is the c++ program:Variables used:startHours, startMins are used to store the starting tim...

Q: Compare and contrast only two types of computer data storage approaches.

A: Comparing and contrasting two data storage approaches:

Q: in python This program requires two functions. In the main function: create an empty list. use a lo...

A: Programming instructions: First, make a list with no values.Then, utilize for-loop to add values in ...

Q: What is the typical size of the security staff in a small organization? A medium-sized organization?...

A: Answer:Size of security staff in a small organization:The size of the security staff in a small-size...