Question

1. Define a class Student which extends Person. It adds the attributes:

Int Test1, test2, test3
Double average
String grade

It has methods computeaverage() and calculategrade().
The grades are based on the average, with above 90 an A, 80 to 90 a B, 70 to 80 a C etc.
All other attributes have a set and a get.

2. Write an application that uses an array of type student of size 20.
The array prompts the user to enter some students and the calculates their grades and prints out the list of students and their grades.

Solution Preview

This material may consist of step-by-step explanations on how to solve a problem or examples of proper writing, including the use of citations, references, bibliographies, and formatting. This material is made available for the sole purpose of studying and learning - misuse is strictly forbidden.

import java.util.Arrays;
import java.util.Scanner;
import javax.swing.JList;
import javax.swing.JOptionPane;
import javax.swing.SwingUtilities;

/**
*
* @author
*/
public class JavaApplication13 {

    /**
    * @param args the command line arguments
    */
    public static void main(String[] args) {
       // TODO code application logic here
       Student [] studentArray = new Student[20];
      // System.out.println("Enter the number of student, the number must be less than 21");
       // get input from keyborad
       Scanner scan = new Scanner(System.in);
       int numberOfStudent;
       //numberOfStudent = scan.nextInt();
       numberOfStudent = Integer.parseInt(JOptionPane.showInputDialog("Enter the number of student, the number must be less than 21"));
       // System.out.println("Enter the information in this form : \n FirstName LastName Test1 Test2 Test3");
      
       if (numberOfStudent > 20) {
            numberOfStudent = 20;
       }...

This is only a preview of the solution. Please use the purchase button to see the entire solution

$15.00

or free if you
register a new account!

Assisting Tutor

Related Homework Solutions

Get help from a qualified tutor
Live Chats