Program that contains two functions in addition to main

Assignment Help C/C++ Programming
Reference no: EM13693287

Question: Write a program that contains two functions in addition to main. The first one takes 2 arguments (an int array and an int) and returns nothing. 

It prints the entire contents of the array argument, one element per line.

You MUST use a for loop to print the array contents. The second function takes 1 argument (an int) and returns a bool indicating whether or not the argument was even or odd. 

Be sure and include prototypes for your functions.

    Your main function should:

Declare an int array of size 3.

Prompt the user for the contents of each array element. Store each input in the array that you declared in Step 1. The user prompt and assignment statements MUST be inside the body of a for loop.

Call the first function that prints an array, passing it the filled array and the array size.

Repeatedly call (using a for loop) the second function each time passing it a different element in the array until all elements have been passed.   Based on the return value of the function, display a message like: " ______ is odd" or "_____ is even"

You need to make well-formed and clean code. You should not copy and paste the code from other source.

Reference no: EM13693287

Questions Cloud

Find the concentrations of x and y in a solution : Find the concentrations of X and Y in a solution
Prepare necessary ledger accounts : Prepare necessary ledger accounts in the books of both thep arties .also show how the consignment stock will appear in the balance sheet.
What is the clinic''s average net float : On a typical day, Park Place Clinic writes $1,000 in checks. It generally takes four days for those checks to clear. Each day the clinic typically receives $1,000 in checks that take three days to clear. What is the clinic's average net float?
Program that prompts the user to enter the mass of a person : Write a program that prompts the user to enter the mass of a person in kilograms and outputs the equivalent weight in pounds.
Program that contains two functions in addition to main : Write a program that contains two functions in addition to main. The first one takes 2 arguments (an int array and an int) and returns nothing.
Draw the ms visio crows feet e-r model : A county wishes to create a database to control its local libraries. Each library has a number of employees, one of whom is designated as the manager of the library and is responsible for supervising employees and the general day-to-day management..
Performance measurement guide to information security : Performance Measurement Guide to Information Security. Using this document, identify five measures you would be interested in finding the results from based on your home computing systems and/or network.
Making a query to produce all clients for one of the sales : Making a query to produce all clients for one of the sales that are assigned to multiple clients - Produce a full client list by each sales person.
Write a program to track hourly employee arrival : A company hires you to write a program to track hourly employee arrival and departure times from work. In essence, you are tasked to make an online time clock - If the user enters an incorrect value more than 3 times, display a prompt that the prog..

Reviews

Write a Review

C/C++ Programming Questions & Answers

  8-bit or 16-bit mode, and the prescaling ratio

8-bit or 16-bit mode, and the prescaling ratio. You can assume XTAL = 10M Hz or at the frequency you specify.

  Goto statements to explicitly

Rewrite the following program fragment using goto statements to explicitly show the flow control through the loop.

  Write mergesort code for data instead of as array

Write mergesort code for data instead of as array - which takes a linked list of integers, as in the bubblesort example code. The decclaration of the struct listnode is the same as in the bubblesort on lists example.

  Prints out a multiplication table up to a specification

Create a program using C++ that prints out a multiplcation table up to a specfic limit. The code should prompt the user for the limit and then print out the table.

  Correct code so that it finds the sum of 20 numbers

Correct the following code so that it finds the sum of 20 numbers.

  Determine an appropriate functional decomposition

Create structure charts for a problem and determine an appropriate functional decomposition or top-down design from a structure chart

  Write a function to compute the volume of a cone

write a function to compute the volume of a cone by using the base radius r and the height h of the cone as the parameters of the function Vcone = xr^2h/3

  Write a complete c program to do the following1 the main

write a complete c program to do the following1. the main program will read in a parameter value n read this in main.

  Create a c++ console application

Objective: Create a C++ console application that will model the characteristics of a resistor. Create a multifile project. Create and add to the project an h file containing the resistor-class definition. Create and add to the project a cpp file cont..

  Computes the area of a rectangle

Create an object oriented application with C# that computes the area of a rectangle, and the area and the volume of a cuboid.

  Write a class volumeofbox that calculate the volume

write a class VolumeOfBox that calculate the volume by this formula : length * breadth *

  Operating system and cpu scheduling

Operating System and CPU Scheduling

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd