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 whilesproviding the output of the software. NB: Using comments, explain any additions oralterations 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<>input.nextInt = f[i];}for(int i = 0;i<>input.nextInt = x[i];}int sum;for(int i = 0;i<>sum + fx[i] = sum;}}
Already registered? Login
Not Account? Sign up
Enter your email address to reset your password
Back to Login? Click here