Write a function named squareall that has 2 args

Assignment Help Computer Engineering
Reference no: EM132196156

Write a C program with the following functions (plus any helper functions youdecide to write):
show: Write a function named show that has 2 args: the first arg is an array of
doubles and the second arg is an unsigned that is the number of elements in thearray. show will not change the array. show may assume without checking that thearray has at least one element. show has no return value. show's job is to output the # of elements in the array, enclosed in []the values of the elements, separated by commas (no comma before the first

element or after the last element).

An example of the output that show might produce (if the array had 5 elements) is [5] 1.1, 2.2, 3.3, 4.4, 5.5(I'm not fussy about formatting niceties like how many digits are displayed after thedecimal point, as long as the values are correct.)
squareAll: Write a function named squareAll that has 2 args: the first arg is an array of doubles and the second arg is an unsigned that is the number of elements inthe array. squareAll may assume without checking that the array has at least oneelement. squareAll has 2 jobs: first, it will square each element in the arraysecond, it will return the sum of those squares. (squareAll doesn't output that

sum, it just returns it.)

For example, if the array held {1.1, 2.0, 3.0} on entry (so the second arg would be 3),then squareAll would change the array to {1.21, 4.0, 9.0} and return 14.21. (Ofcourse, your function will work for arrays of any size, not just size 3.
minAve: Write a function named minAve that has 4 args:
The first arg is a pointer to a double variable in the caller. This double variable isunpredictable garbage when minAve starts. minAve will change this double tothe minimum value. For example, if the third arg held {2.0, 1.0, 9.0} (so thefourth arg would be 3), then minAve would set this double to 1.0 .The second arg is a pointer to another double variable in the caller. This doublevariable is also unpredictable garbage when minAve starts. minAve willchange this double to the average value. For example, if the third arg held

{2.0, 1.0, 9.0}, then minAve would set this double to 4.0 .The third arg is an array of doubles. minAve will not change this array.The fourth arg is an unsigned that is the number of elements in the array. minAvemay assume without checking that the array has at least one element.

main: Your main function should
create an array of doublessomehow get values into the arraycall show to display the array contentspass the array to squareAll to square all the elements of the array.call show again to display the array contents after squaringcall minAve to get the minimum and average values in the arrayOutput the minimum and average values with explanatory textFor example, of your array held {10.0, 1.0, 4.0}, then your main should outputsomething like[3] 10.0, 1.0, 4.0[3] 100.0, 1.0, 16.0min is 1.0, ave is 39.0

Reference no: EM132196156

Questions Cloud

Marketing planning worth the effort : Is marketing planning worth the effort, especially in the current rapidy changing external/macro environment?
Create a representation of an university information system : Create a representation of an Alabama University information system that will contain information about the university.
Define what was the result of your research : Take just a moment to think about something you have researched in the past, and describe what that experience was like. What did you research?
What does it mean to differentiate a service : What does it mean to differentiate a service? How can you use it to increase target market interest?
Write a function named squareall that has 2 args : Write a function named squareAll that has 2 args: the first arg is an array of doubles and the second arg is an unsigned that is the number of elements .
Summarize the sources that you have gathered to support : The purpose of the annotated bibliography is to summarize the sources that you have gathered to support your research proposal project.
Describe ways that technology and social media have changed : Identify the three findings and describe ways that technology and social media have changed the roles of managers since Mintzberg's 1960 study.
Write a program that performs keyboard input data : Implement a second version of the program, instead of an array to use the doubly linked list; add elements so as to preserve the ordering.
How can a strategic plan be firm yet flexible : How can a strategic plan be firm yet flexible? What does it need to include?

Reviews

Write a Review

Computer Engineering Questions & Answers

  Explain the importance of understanding the various branches

Explain the importance of understanding the various branches of security covered in Chapter 1. Engineering Information Security.

  How many bytes does this string take in the memory

If a string is stored at the memory address 0 times 20008000 and the string is "Cortex-M", show the memory content in hex format starting at 0 times 20008000.

  Explain the common user interface

Think about how the Microsoft Office applications have been designed to work together. Look at the user interfaces of all the Microsoft Office applications you have installed on your computer and define the common user interface and features you s..

  Relationship between programming languages and applications

The consultants suggested using object-oriented technology. still the internal information systems team was hesitant to use object-oriented technology. They instead suggested using structured programming.

  Design the logic for the game hangman

Design the logic for the game Hangman, in which the user guesses letters in a hidden word. Store the letters of a word in an array of characters.

  Test hypothesis that there is no difference in performance

Test the hypothesis that there is no difference in performance on each exam versus the alternative that exam 2 performance was poorer.

  Develop a method for configuring and managing a software

Develop a method for configuring and managing a software repository. After creating the solution, search for available version control tools. Select the tool you believe to be the best to implement your solution.

  Derive the elements for general rotation matrix given in

By evaluating terms in derive elements for general rotation matrix given in. Prove that any two successive rotations about a given rotation axis is commutative.

  Design a program that bounces a blue ball inside a jpanel

design a program that bounces a blue ball inside a JPanel. The ball should begin moving with a mousePressed event. When the ball hits the edge of the JPanel, it should bounce off the edge and continue in the opposite direction. The ball should be u..

  Explain the given instructions

List the changes needed to convert ASC HCU to include three modules-fetch, defer, execute-working in a pipeline mode. Assume that only LDA, STA, SHR, TCA, LDX.

  How does big data help businesses make decisions

Turn into the assignment link the answers to the following questions ( in your OWN WORDS ): What is big data? How does big data help businesses make decisions?

  Private base class function declared public in derived class

Private base class function declared public in derived class

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