Computes the average of all those numbers

Assignment Help Computer Engineering
Reference no: EM132116107

QA questions

a. Select minimum number of test cases to achieve 100% statement coverage in ReturnAverage()

b. Select minimum number of paths to achieve 100% branch coverage in ReturnAverage()

/* Function: ReturnAverage computes the average of all those numbers in the input array in the positive range [MIN, MAX]. The maximum size of the array is AS. But, the array size could be smaller than AS in which case the end of input is represented by -999. */

public static double ReturnAverage(int value[], int AS, int MIN, int MAX){

int i, ti, tv, sum;

double av;

i = 0; ti = 0; tv = 0; sum = 0;

while (ti < AS && value[i] != -999) {

ti++;

if (value[i] >= MIN && value[i] <= MAX) {

tv++;

sum = sum + value[i];

}

i++;

}

if (tv > 0)

av = (double)sum/tv;

else

av = (double) -999;

return (av);

}

Reference no: EM132116107

Questions Cloud

Will it be profitable to take the $2,000 today : Someone just offered you $2,000 today to buy out your investment. Will it be profitable to take the $2,000 today?
How much if you want to pay yourself : How much if you want to pay yourself $450 at the beginning of each month?
What are the contents of register a after the execution : What are the contents of the stack, SP register at the end of the following program segment? LDS #$01FF PSHA PSHB PSHY
Identify the tasks the potential users will perform : HS2031 Human Computer Interaction (HCI) - HCI - Heuristic evaluation plan for a university learning management system - Perform a user analysis.
Computes the average of all those numbers : Select minimum number of test cases to achieve 100% statement coverage in ReturnAverage()
How much must you invest in your account : How much must you invest in your account today if you want to pay yourself $230 at the end of each of the next 15 years?
How much will you have saved : If instead of investing in the account, you saved your money in your cookie jar. How much will you have saved?
Why is quadruple precision more than twice : Why is quadruple precision (128 bits) more than twice as accurate as double precision (64-bit).
Manage a hedge fund : You manage a hedge fund with $400 million in assets. Your fee structure provides for a 1% annual management fee with a 20% incentive on returns

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