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

  Assume the javascript variables greeting

Write down a line of code to replace line 3 above which will create a greeting 'Hello Earthling!' with a space in between 'Hello' and 'Earthling' and an exclamation mark at the end.

  What were the risks and impact if the implementation failed

What is the problem driving the implementation? What is ‘going wrong' or what ‘problem' was expected to be addressed? What were the risks and impact.

  What might be the better measure for central tendency

What might be the better measure for central tendency? (i.e., mean, median, or mode) and why? Report the standard deviation.

  Explain business considerations relating to security policy

You work as a junior security analyst for a governmental organization with Department of Defense (DoD) ties. Your manager has asked you to.

  What competitive advantage will gain

What competitive advantage will you gain by establishing SDLC and following rigid processes and procedures? List your response in bulleted format and provide details for each.

  Design a basic jsp page

Submit your JSP page along with your screenshots that show what your code has produced

  Discuss how you may have to adjust the bios settings

vcdiscuss how you may have to adjust the BIOS settings when you install them.Based on your learning this week, how does the BIOS/CMOS manage

  What can be done to reduce the risk that these threats pose

What can be done to reduce the risk that these threats pose. Discuss your thoughts on if and how the Clark-Wilson security model could be used to help protect data, or would a different security model be more appropriate? If so, which one

  Questionbubble sort is an easy sorting algorithm it works

questionbubble sort is an easy sorting algorithm. it works by repeatedly stepping throughout the list to be sorted

  Create a simple telephone list

Write a shell script (called phone) that creates a simple telephone list (create an empty file called "phonelist" in your home directory).

  How does one evaluate types of tracking beacon variable pass

How does one evaluate the types of tracking beacon variables passed to the analytics platform collection servers? How do tracking beacon audits help ensure reliable data collection?

  List the possible formats for presenting menus to a user arc

List the possible formats for presenting menus to a user arc' explain under what circumstances each might be appropriate.

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