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

  Create program that uses functions and reference parameters

Create program that uses functions and reference parameters, and asks user for the outside temperature.

  Write a program using vectors and iterators

Write a program using vectors and iterators that allows a user to maintain a personal list of DVD titles

  Write the code required to analyse and display the data

Calculate and store the average for each row and column. Determine and store the values for the Average Map.

  Write a webservices application

Write a webservices application that does a simple four function calculator

  Iimplement a client-server of the game

Iimplement a client-server version of the rock-paper-scissors-lizard-Spock game.

  Model-view-controller

Explain Model-View-Controller paradigm

  Design a nested program

How many levels of nesting are there in this design?

  Convert celsius temperatures to fahrenheit temperatures

Write a C++ program that converts Celsius Temperatures to Fahrenheit Temperatures.

  Evaluate and output the value in the given base

Write C program that will input two values from the user that are a Value and a Base with which you will evaluate and output the Value in the given Base.

  Design a base class shape with virtual functions

Design a base class shape with virtual functions

  Implementation of classes

Implementation of classes Chart and BarChart. Class barChart chould display a simple textual representation of the data

  Technical paper: memory management

Technical Paper: Memory Management, The intent of this paper is to provide you with an in depth knowledge of how memory is used in executing, your programs and its critical support for applications.

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