Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

The bottom portrays a homework assignment for my CSCE155A class intro to compute

ID: 643639 • Letter: T

Question

The bottom portrays a homework assignment for my CSCE155A class intro to computer science with java. I am supposed to write a code that creates a random generation of students and grades for them. All of the details are at the bottom, however I am very confused as to how to even start this. Please help!

Write a program that processes the statistics for grades for a group of students in the CSCE155A class. In order to do this, you need to store this information in a Java two-dimensional array of values representing points earned in the class. Dimension 1 represents the students and dimension 2 represents the categories of points, which is as follows:

Homework Assignments (25%)

Explanation / Answer

import java.util.Random;
import java.util.Scanner;


public class Students {
   public static void main(String args[]){
       Scanner in = new Scanner(System.in);
       System.out.print("Enter seed value: ");
       int seed = in.nextInt();
       Random r = new Random(seed);
       System.out.print("Number of students: ");
       int n = in.nextInt();
       while(n < 2 || n > 100){
           System.out.println("Range of number of students is [2 - 100]");
           System.out.print("Number of students: ");
           n = in.nextInt();
       }
       int scores[][] = new int[n][6];
       for(int i = 0; i < n; ++i){
           scores[i][0] = r.nextInt(301) + 300;
           scores[i][1] = r.nextInt(301) + 300;
           scores[i][2] = r.nextInt(301) + 300;
           scores[i][3] = r.nextInt(51) + 50;
           scores[i][4] = r.nextInt(201) + 200;
           scores[i][5] = r.nextInt(251) + 250;
       }
       int total[] = new int[n];
       double per[] = new double[n];
       for(int i = 0; i < scores.length; ++i){
           int sum = 0;
           double p = 0.0;
           sum += scores[i][0];
           sum += scores[i][1];
           sum += scores[i][2];
           sum += scores[i][3];
           sum += scores[i][4];
           sum += scores[i][5];
           p += (scores[i][0] / 6 * 0.25);
           p += (scores[i][1] / 6 * 0.25);
           p += (scores[i][2] / 6 * 0.25);
           p += (scores[i][3] * 0.0417);
           p += (scores[i][4] / 4 * 0.1667);
           p += (scores[i][5] /5 * 0.2083);
           if(p > 100){
               p = 100;
           }
           total[i] = sum;
           per[i] = p;
       }
       System.out.println("student Total Percentage");
       for(int i = 0; i < n; ++i){
           System.out.printf("%d %d %.2f ", (i + 1), total[i], per[i]);
       }
   }
}

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote