The Java program below is supposed to solved for the equation f= ∑ but has logical, syntax errors and is also incomplete. Carefully rewrite the codes by correcting all syntax and logical errors with the software whiles providing the output of the software. NB: Using comments, explain any additions or
Question 1.
The Java program below is supposed to solved for the equation f=
∑
but has logical,
syntax errors and is also incomplete.
Carefully rewrite the codes by correcting all syntax and logical errors with the software whiles
providing the output of the software. NB: Using comments, explain any additions or
alterations to the line of codes you write.
import java.util.Scanner;
public class Stats {
int main;
Scanner input = new Scanner(System.in);
System.out.println("How many numbers do you have");
int n;
n = input.nextInt;
for(int i = 0;i<=n-1;i++){
input.nextInt = f[i];
}
for(int i = 0;i<=n-1;i++){
input.nextInt = x[i];
}
int sum;
for(int i = 0;i<=n-1;i++){
sum + fx[i] = sum;
}
}
Trending now
This is a popular solution!
Step by step
Solved in 2 steps with 2 images