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

  Draw a two-dimensional house seen from the front

Draw a two-dimensional house seen from the front, the way a child would: with a dor, two windows, and a roof with a chimney

  Write a program to find the average value

Write a program to find the average value, the largest value, and the smallest value of a set of numbers supplied as input from the keyboard. The number of values in the data set must be in the range 0 to 20, inclusive.

  Calculate and display the number of units of electricity

The manager of PG&E wants a program that calculates a customer's electric bill. He will enter the current and previous meter readings.

  A program that takes into account a pre given array

Problem: A program that takes into account a pregiven array and prompts the user to enter a return per minute value.

  Two-dimensional array of double to hold the sales

Suppose you have a two-dimensional array of double to hold the sales amounts for all your salespeople three years. Assume you employ 50 salespeople and this array already holds valid data.

  Program on basic arithmetic operation

Two integers must be compared before the arithmetic operation and Subtract the two integers provided the first integer is greater than the second integer, otherwise add the two integers and subtract the second integer from the first integer.

  Techniques for information hiding and encapsulation

What techniques did you utilize for information hiding and encapsulation? Are there any improvements you would make? If so, what would they be?

  C code christmas assignment

C code Christmas assignment. We are supposed to create a record generating programme that will accept user information and output student information (student grade, highest and lowest grade, pass or fail status). Must be done in modular form,..

  Write an array-returning method

Write an array-returning method that takes a two-dimensional array of chars as a parameter and returns a single-dimensional array of Strings as follows:

  Write function that finds the minimum of three double value

1. Write a function that finds the minimum of three double values. This function should use another function that finds the minimum of two double values.

  Give a recursive definition of s.

Let S be the set of positive integers that can be written as a sum of one or more 4's and/or 7's. For example, 7 ? S and 18 ? S (because 18 = 4 + 7 + 7)

  Design a class named employeerecord

Design a class named EmployeeRecord that holds an employee's ID number, name, and payrate. Include mutator methods to set the values for each data field and output the values for each data field. Create the class diagram and write the code that

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