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

  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