Can someone help me write a program to compute the computer programming grades of 8 IT students.

● Randomly create student numbers for each of the students and store each in an array.

The program should take the input of (validate the input where appropriate):

● Names of Students and store them in an array.

● Addresses of Students and store them in array.

● Previous Grade for student. (A,B,C…..)

● Marks for ‘Computer Programming Assignment 1’ (out of 25 marks)

● Marks for ‘Computer Programming Assignment 2’ (out of 25 marks)

● Marks for ‘Computer Programming Exam’ (out of 50 marks)

● Based on the above input, work out the ‘Final Marks’ for Computer Programming (Assignment

1 + Assignment 2 + Exam) and store it in an array.

Then work out and display

● The average Final Grade for the ‘Computer Programming’ class 2013.

● The number of A’s, B’s, C’s, D’s, and Fails for ‘Computer Programming’ 2013

● The name, address, previous grade, this year’s grade, percentage, and student number for

each student.

Edited 3 Years Ago by lf95

As you have not shown any work I cannot provide you with any specific examples, however you will want to take a look at the Random class and arrays

Please show the work you have done and ask a specific question to get more helpful results.

{/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package Assignment2;
import javax.swing.*;
import java.util.Arrays;
/**
 *
 * @author francis.38758
 */
public class Main
{

    /**
     * @param args the command line arguments
     */
    public static void main(String[] args)
{
    int[] anArray;
    anArray = new int[8];

    String[] firstname = new String [8];
    String[] address = new String [8];
    String[] previousgrade = new String [8];
    double[] assign1 = new double [8];
    double[] assign2 = new double [8];
    double[] exam = new double [8];

    int [] num = new int [8];
    int n=0;

    for (n=0; n<firstname.length; n++)
{
    num[n] = (int)(Math.random()*100000);
    firstname [n] = JOptionPane.showInputDialog("Please enter your name");
    address [n] = JOptionPane.showInputDialog("Please enter your surname");
    previousgrade [n] = JOptionPane.showInputDialog("Please enter your previous grade");
    assign1 [n] = Double.parseDouble(JOptionPane.showInputDialog("Please enter your marks for assignment 1"));
    assign2 [n] = Double.parseDouble(JOptionPane.showInputDialog("Please enter your marks for assignment 2"));
    exam [n] = Double.parseDouble(JOptionPane.showInputDialog("Please enter your marks for the exam"));
}
{











        JOptionPane.showMessageDialog(null, (num[n] + " " + firstname[n] + address[n]));

}
}
}



/**
 * @param args the command line arguments
 */
public static void main(String[] args)
This article has been dead for over six months. Start a new discussion instead.