Answer:
There are some fundamental activities that are common to all software processes:
•Software specification. In this activity the functionality of the software and constraints on its operation must be defined.
•Software design and implementation. ...
•Software validation. ...
•Software evolution
Answer:
def index(elem, seq):
for i in range(len(seq)):
if elem == seq[i]:
return i
return len(seq)
print(index(5, [4, 10, 8, 5, 3, 5]))
Explanation:
Create a function named index that takes elem and seq as parameters
Create a for loop that iterates through the seq. If elem is equal to the item in the seq, return the i, index of the item.
If the elem is not found in the seq, this means nothing will be returned in the loop, just return the length of the seq, len(seq)
Call the function with given parameters and print the result
Note: Since 5 is in the list in the example, the index of the 5 which is 3 will be returned
Answer:
#include <bits/stdc++.h>
using namespace std;
int lowestPosition(double elements[],int n)//function to find position of lowest value element.
{
int i,pos;
double min=INT_MAX;
for(i=0;i<n;i++)
{
if(elements[i]<min)
{
min=elements[i];
pos=i;//storing index.
}
}
return pos+1;//returning pos +1 to give the correct position in the array.
}
int main() {
double ele[500];
int n;
cout<<"Enter number of values"<<endl;
cin>>n;
cout<<"Enter elements"<<endl;
for(int i=0;i<n;i++)
{
cin>>ele[i];
}
int pos=lowestPosition(ele,n);//function call.
cout<<"The position of element with minimum value is "<<pos<<endl;
return 0;
}
Output:-
Enter number of values
5
Enter elements
4 6 7 5 1
The position of element with minimum value is 5
Explanation:
I have created a function lowestPosition() with arguments double array and it's size.I have taken a integer variable pos to store the index and after finding minimum and index i am returning pos+1 just to return correct position in the array.
The one that does not belong there is high income.