Write the definitions of the functions

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

Consider the following function main:

int main ()
{
Int inStock [10] [4];
Int alpha [20];
Int beta [20];
Int gamma [4] = {11, 13, 15, 17};
Int delta [10] = {3, 5, 2, 6, 10, 9, 7, 11, 1, 8};
.
.
.
}

a) Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.

b) Write the definition of the function inputArray that prompts the user to input 20 numbers and stores the numbers into alpha.

c) Write the definition of the function doubleArray that initializes the elements of beta to two times the corresponding elements in alpha. Make sure that you prevent the function from modifying the elements of alpha.

d) Write the definition of the function copyGamma that sets the elements of the first row if inStock to gamma and the remaining rows of inStock to three times the previous row of inStock. Make sure that you prevent the function from modifying the elements of gamma.

e) Write the definities of the function copyAlphaBeta that stores alpha into the first five rows of inStock and beta into the last five rows of inStock. Make sure that you prevent the function from modifying the elements of alpha and beta.

f) Write the definition of the function printArray that prints any one-dimensional array of type int. Print 15 elements per line.

g) Write the definition of the function setInStock that prompts the user to input the elements for the first column of inStock.

The function should then set the elements in the remaining columns to two times the corresponding element in the previous column, minus the corresponding element in delta.

h) Write C++ statements that call each of the functions in parts a through g.

i) Write a C++ program that tests the function main and the function discussed in parts a through g. Add additional functions, such as print a two-dimensional array, as needed.

Reference no: EM13937865

Questions Cloud

What must the risk-free rate : A stock has an expected return of 15.1 percent, a beta of 1.60, and the expected return on the market is 11.40 percent. What must the risk-free rate be?
What effective annual interest rate does the firm earn : What effective annual interest rate does the firm earn when a customer does not take the discount? What effective annual interest rate does the firm earn if the terms are changed to 3.4/7, net 30, and the customer does not take the discount. What eff..
Calculate the earnings per share the company would report : Calculate the earnings per share the company would report on the income statement assuming Ski Daddle had 100,000 shares of common stock outstanding during the year and paid preferred dividends of $15,000.
What is the name header file (name.h) : getFirstLast Function: it returns the first and middle name and last name in order.
Write the definitions of the functions : Write the definition of the function setZero that initializes any one-dimensional array of type int to 0.
E-portfolio assignment aims : The e-portfolio assignment aims to enhance your weekly learning and teaching as per the weekly topic and maximise your engagement with the course resources (please see weekly topics under Schedule in this course profile).
Making a living or working yourself to death : Making a living or working yourself to death? Exploring the brave new world of work
Describe the use of the four management styles in management : In this discussion forum: Describe the use of the four management styles in the management of your personal life as it relates to this class. How does this translate to other projects, programs, and/or business operations and specifically to team ..
Recent developments in e-business industry : 1. Articulate the recent developments in e-business industry and its likely future directions. 2. Compare and explain various types of e-business infrastructure technologies, business models, and payment and security systems in a corporate setting.

Reviews

Write a Review

C/C++ Programming Questions & Answers

  Write a program to illustrate how to use your class

Declare an array of 10 components of type bankAccount to process up to 10 customers and write a program to illustrate how to use your class.

  Class to act as a generic array

Create a class to act as a generic array (i.e. the user will be able to choose the data type to be stored by passing the appropriate template argument.

  Which of the following prototypes would work

Which of the following prototypes would work for the function called func?

  How do you make a row with different string names

How do you make a row with different string names and put a certain amount of space between each one?

  Create a detailed ipo chart

Create a detailed IPO chart that also includes the algorithm from the attached c++ source code.

  An evaluation of blogger

*An evaluation of Blogger *Identify and discuss the online blogs you examined and their usefulness Discuss the place blogging holds in today's availability of information, *and its advantages/disadvantages over more traditional formats such as newspa..

  Parallel numeric arrays

Create and code a program that uses three parallel numeric arrays of size 6. The program searches one of the arrays and then displays the corresponding values from the other two arrays.

  Books with suitable members

Design a system using a class called Books with suitable members

  Calculation of mortgage interest rates

Instruction of pointers and the calculation of mortgage interest rates.

  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.

  What is realistic rendering in computer graphic

Differentiate between pillar boxing and the letter boxing. What is realistic rendering in computer graphic. Discuss the approach used in realistic rendering.

  The array is sorted except the first one

the array is sorted except the first one

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