1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Elanso [62]
2 years ago
12

The purpose of this assignment is to determine a set of test cases knowing only the function’s specifications, reported hereaf

ter:The program takes as input a 2D matrix with N rows. The program finds the column index of the first non-zero value for each row in the matrix A, and also determines if that non-zero value is positive or negative. It records the indices of the columns, in order, in the array W. It records whether each value was positive or negative, in order, in the array T (+1 for positive, -1 for negative). Assume that all rows have at least one column with a non-zero value.As this is black-box testing, you will not have access to the source so you must use what you have learned.You need to include a comment that describes how you chose your test cases.Students should identify the input equivalence partitions classes and select test cases on or just to one side of the boundary of equivalence classes.Students will gain 25 points for each input equivalence partition classes and valid test cases reported.Any language can be used, preferably C or C++ but it's not an issue if it's not in these two. Thanks!
Computers and Technology
1 answer:
Nesterboy [21]2 years ago
5 0

Answer:

The program is written using PYTHON SCRIPT below;

N=int(input(" Enter number of Rows you want:"))

M=[] # this for storing the matrix

for i in range(N):

l=list(map(int,input("Enter the "+str(i+1)+" Row :").split()))

M.append(l)

print("The 2D Matrix is:\n")

for i in range(N):

print(end="\t")

print(M[i])

W=[] # to store the first non zero elemnt index

T=[] # to store that value is positive or negative

L=len(M[0])

for i in range(N):

for j in range(L):

if (M[i][j]==0):

continue

else:

W.append(j) # If the value is non zero append that postion to position list(W)

if(M[i][j]>0): #For checking it is positive or negative

T.append(+1)

else:

T.append(-1)

break

print()

print("The first Non Zero element List [W] : ",end="")

print(W)

print("Positive or Negative List [T] : ",end="")

print(T)

Explanation:

In order for the program to determine a set of test cases it takes in input of 2D matrix in an N numbet of rows.

It goes ahead to program and find the column index of the first non-zero value for each row in the matrix A, and also determines if that non-zero value is positive or negative. The If - Else conditions are met accordingly in running the program.

You might be interested in
a computer technician performed a number of actions to correct a problem. some actions did not solve the problem, but eventually
padilas [110]

The technician should document all that was done to try to solve the problem. A detailed record is a good practice to find solutions.

A detailed record documenting all steps by which a problem was solved is a good practice for technicians.

This documented record will help the computer technician to find the cause the next time.

Clear, accurate records support decision-making and solving problems in any job and profession.

Learn more about detailed records here:

brainly.com/question/6284693

4 0
2 years ago
What is cloud storage?​
Aleks [24]

Cloud storage is a service model in which data is maintained, managed, backed up remotely and made available to users over a network (typically the Internet).

3 0
3 years ago
According to shared security model, which two are a customer's responsibilities in Oracle Cloud Infrastructure (OCI)?
sashaice [31]

Answer:

According to shared security model, a customer's responsibilities in Oracle Cloud Infrastructure (OCI) are:

1. Workloads security: The customer is responsible for protecting the work function or a distinct capacity, like a Hadoop node, a Web server, a database, or a container, that it puts on the cloud.

2. Services configuration:  The customer is also responsible for securing the specifications that describe the different aspects of its managed service.

Explanation:

Responsibilities are shared between Oracle and the customers using the Oracle Cloud Infrastructure (OCI).  Oracle is solely responsible for the security of the underlying cloud infrastructure (such as data-center facilities, hardware, and software systems), while the customer is responsible for securing the workloads and configuring their services to suit their individual needs.

8 0
3 years ago
Do the same exercise but this time use the value returning function. Here is the skeleton of the main function. Write functions
AfilCa [17]

Answer:

The function prototypes are as follows:

<em>int findSum(int fn, int sn, int tn);</em>

<em>int findMin(int fn, int sn, int tn);</em>

<em>int findMax(int fn, int sn, int tn);</em>

The functions are as follows:

int findSum(int fn, int sn, int tn){

   return fn+sn+tn;}

int findMin(int fn, int sn, int tn){

   int min = fn;

   if(sn<=min && sn<=tn){

       min = sn;    }

   if(tn <= min && tn <= sn){

       min = tn;    }

   return min;}

int findMax(int fn, int sn, int tn){

   int max = fn;

   if(sn>=max && sn>=tn){

       max = sn;    }

   if(tn>=max && tn>=sn){

       max = tn;    }

   return max;}

Explanation:

Given

See attachment 1 for the main function

Required

Write the following functions

  • findSum
  • find Min
  • findMax.

The following represents the function prototypes

<em>int findSum(int fn, int sn, int tn);</em>

<em>int findMin(int fn, int sn, int tn);</em>

<em>int findMax(int fn, int sn, int tn);</em>

This declares the findSum function

int findSum(int fn, int sn, int tn){

This returns the sum of the three numbers

   return fn+sn+tn;}

This declares the findMin function

int findMin(int fn, int sn, int tn){

This initialzes min (i.e. minumum) to fn

   int min = fn;

This checks if sn is the minimum

<em>    if(sn<=min && sn<=tn){</em>

<em>        min = sn;    }</em>

This checks if tn is the minimum

<em>    if(tn <= min && tn <= sn){</em>

<em>        min = tn;    }</em>

This returns the minimum of the three numbers

   return min;}

This declares the findMax function

int findMax(int fn, int sn, int tn){

This initialzes max (i.e. maximum) to fn

   int max = fn;

This checks if sn is the maximum

   if(sn>=max && sn>=tn){

       max = sn;    }

This checks if tn is the maximum

<em>    if(tn>=max && tn>=sn){</em>

<em>        max = tn;    }</em>

This returns the maximum of the three numbers

   return max;}

<em>See cpp attachment for complete program which includes the main</em>

3 0
2 years ago
What’s the difference between the alternative press and a tabloid?
miskamm [114]

Answer:

Alternative Press just differs in opinion from mainstream media. A tabloid is literally smaller and is contains sensationalist and largely photographic content.

Most alternative presses aren't reliable and are effectively tabloids in nature, but their content differs.

4 0
2 years ago
Other questions:
  • In a case where electrical current leakage from the circuit occurs,
    7·2 answers
  • ___________ is an unsecured client server application / protocol that transfers files between two computers.
    11·1 answer
  • Preesure is drived quantity? why​
    15·2 answers
  • What is Mainframe computer​
    15·1 answer
  • Please list the computer data hierarchy from bit to database
    6·1 answer
  • The area of a rectangle is the rectangle's length times its width.
    5·1 answer
  • What is a traditional tool used to align and mark vertical points from top to bottom?
    10·1 answer
  • An IT security threat is anything that might cause serious harm to a computer system, including someone stealing a laptop that c
    8·2 answers
  • A multi-national retail company has multiple business divisions with each division having its own AWS account. The engineering t
    9·1 answer
  • Word can only print documents on one size of paper.<br><br> True or false
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!