Answer:
See Explaination
Explanation:
package testscores;
import java.util.ArrayList;
import java.util.List;
public class TestScores {
public List<Integer> scorearray=new ArrayList<>();
public TestScores(List<Integer> scores) throws InvalidTestScore{
this.scorearray=scores;
for(int i=0;i<scorearray.size();i++){
if(scorearray.get(i)>100 || scorearray.get(i)<0){
throw new InvalidTestScore(this.scorearray.get(i));
}
}
}
public double average(){
int tot=0;
for(int i=0;i<this.scorearray.size();i++){
tot=tot+this.scorearray.get(i);
}
return tot*(1.0)/(this.scorearray.size());
}
class InvalidTestScore extends Exception
{
private double amount;
public InvalidTestScore(int Score)
{
System.out.println("Invalid Score "+Score);
}
}
}
Answer:
System of linear equations is solved below and explained in detail.
Explanation:
Part a:
M = [1 3 5 2; 2 -4 7 -3; 0 -4 -7 3; 5 -3 2 1];
c = [7; -3; -1; 0];
Part b:
The statement used for the solution of system of linear equation will be:
X = linsolve(M,c)
where X will give the values of x1, x2, x3, x4 respectively.
Part c:
The system is solved in matlab using above equation and the results are attached in a file.
The values for X are:
x1 = -2/7
x2 = 3/7
x3 = 4/7
x4 = 11/7
Answer:
B
Explanation:
because you need to exercise and eat or drink less calories
Answer:
A: used by ISP's to filter out email SPAM
C: a way to help an individual focus on best choices when deciding what to watch or buy.
Explanation:
Collaborative filtering uses a community-based approach to filter spam. It works by collecting numerous email users from around the world. By doing this, it becomes possible for users to flag emails that are spam and those that are legitimate.
Also Collaborative Filtering is one of the most efficient techniques for building a system that can help a user when it comes to recommending best choices based on information from a large number of users.
Answer:
B.O(1)
Explanation:
When we are implementing ADT stack using linked chain we can pop an entry from the stack having O(1) time complexity because in linked chain we have the head or top pointer in linked chain only.Popping and pushing in stack happens on only one end that is top.So we have move to move top in linked chain to the next and delete prev node.