Fill the array with ten doubles entered by the user

Assignment Help Computer Engineering
Reference no: EM132216473

You are to write three functions for this lab:

double mean(const double array[], int arraySize);

Passes in an array along with the size of the array.

Returns the mean of all values stored in the array.

void remove(double array[], int &arraySize, int index);

Passes in an array, the size of the array by reference, and the index of a value to be removed from the array.

Removes the value at this index by shifting all of the values after this value up, keeping the same relative order of all values not removed.

Reduces arraySize by 1.

void display(const double array[], int arraySize);

Passes in an array and the size of the array.

Outputs each value in the array separated by a comma and space, with no comma, space or newline at the end.

main function requirements

To test these functions, your main function should follow these steps:

Declare an array of doubles of size 10.

Fill the array with 10 doubles entered by the user.

Call the mean function passing it this array and output the value returned.

Ask the user for the index (0 to 9) of the value they want to remove.

Call the display function to output the array.

Call the remove function to remove the value at the index provided by the user.

Call the display function again to output the array with the value removed.

Here's a sample run of the program:

Enter 10 values: 4 4 5 6 8 9 10 5 2 1 Mean: 5.4 Enter index of value to be removed: 3 Before removing value: 4, 4, 5, 6, 8, 9, 10, 5, 2, 1 After removing value: 4, 4, 5, 8, 9, 10, 5, 2, 1

Reference no: EM132216473

Questions Cloud

Describe the marketing plan : Locate 7 articles related to possible marketing plan topics. The topic should be geared toward the implementation of a new sport related product or service.
Write and test using an appropriate main program : Write and test, using an appropriate main program, the following function that is passed an array of n pointers to integers.
Summarize the hpt landscape model : In your own words not from the text book, what are the most important descriptors of HPT? And Why? Summarize the HPT Landscape Model?
Explain the elements of project management : Explain the elements of project management and its relationship to human resource management. Assess organizational strategies that contribute to effective.
Fill the array with ten doubles entered by the user : Call the display function to output the array. Call the remove function to remove the value at the index provided by the user.
Convert a complex number in rectangular form : Write and test thoroughly a MATLAB function which converts a complex number in rectangular form.
Display the integers 50 through 1 in descending order th : Write two short segmentd of code that displays the integers 50 through 1 in descending order on the console.
Write two pep-7 machine language instructions : Write two Pep/7 machine language instructions that put the value 0000000100000001 into the A register and then adds the value 0000000000000010 to it.
Write and test a mips program with mars consisting functions : Write and test a MIPS program with MARS consisting of four functions. Note: In the following descriptions, the symbol & means "address of".

Reviews

Write a Review

Computer Engineering Questions & Answers

  Mathematics in computing

Binary search tree, and postorder and preorder traversal Determine the shortest path in Graph

  Ict governance

ICT is defined as the term of Information and communication technologies, it is diverse set of technical tools and resources used by the government agencies to communicate and produce, circulate, store, and manage all information.

  Implementation of memory management

Assignment covers the following eight topics and explore the implementation of memory management, processes and threads.

  Realize business and organizational data storage

Realize business and organizational data storage and fast access times are much more important than they have ever been. Compare and contrast magnetic tapes, magnetic disks, optical discs

  What is the protocol overhead

What are the advantages of using a compiled language over an interpreted one? Under what circumstances would you select to use an interpreted language?

  Implementation of memory management

Paper describes about memory management. How memory is used in executing programs and its critical support for applications.

  Define open and closed loop control systems

Define open and closed loop cotrol systems.Explain difference between time varying and time invariant control system wth suitable example.

  Prepare a proposal to deploy windows server

Prepare a proposal to deploy Windows Server onto an existing network based on the provided scenario.

  Security policy document project

Analyze security requirements and develop a security policy

  Write a procedure that produces independent stack objects

Write a procedure (make-stack) that produces independent stack objects, using a message-passing style, e.g.

  Define a suitable functional unit

Define a suitable functional unit for a comparative study between two different types of paint.

  Calculate yield to maturity and bond prices

Calculate yield to maturity (YTM) and bond prices

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