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

  What is a data scientist and what does the job involve

What are recommender systems, how are they developed, and how is the data used to build a recommendation system obtained?

  Create an employee class with enough numbers

Create an Employee class with enough numbers.

  Calculate and output the walls area

Prompt the user to input a wall's height and width. Calculate and output the wall's area.

  Describe the actions in one limited play period

Choose a sport such as baseball or football and describe the actions in one limited play period using a structured flow chart or pseudo code.

  How do the sales volume in each store relate to revenues

How do the sales volume in each store relate to revenues? How does this relationship depend on the configuration?

  How the shift alters the optimal total cost

Construct a table to show, for shift amounts up to 15,000 square feet, how the shift alters the optimal total cost.

  What are the different types of cloud services?

What are the different types of cloud services?

  What are the advantages of the osi reference model

Using the layers of the OSI model as a reference, explain and sketch how repeaters, hubs, bridges, switches, routers, and gateways function in forwarding packets from one host to another through each device respectively.

  Research the impact of a fade margin

Research the impact of a fade margin less than 10dB on a wireless network in the following conditions like Severe weather conditions.

  How would an attacker break a caesar-style cipher

Julius Caesar used one of the earliest known cipher systems to communicate with Cicero in Rome while he was conquering Europe.

  What is the problem for which this technology is solution

What is the problem for which this technology is the solution? Which people and what institutions might be most seriously harmed by a technological solution?

  What happens in stages d e m for a store instruction sw

Assume that registers are written in the 1st half of the clock cycle. Write the RTL code describing what happens in stages D, E, M for a store instruction SW.

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