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 $1 if you
register a new account!

Assisting Tutor

Related Homework Solutions

World Puzzle Problem & Arrays in Java
Homework Solution
$60.00
Java
Programming
Codes
Algorithms
Arrays
Word Puzzles
Input
Output
Running Time
Integers
Loops
Maximum Count
Divide And Conquer Method
Statements
Variables
Recursive Calls
Arrays in Programming Language Java
Homework Solution
$20.00
Java
Programming
Computer Science
Arrays
Integers
Random Numbers
Methods
Functions
Even Elements
Odd Elements
Prime Numbers
Minimum Values
Maximum Values
Average Values
Loops
Conditions
Statements
Classes in Java Programming
Homework Solution
$20.00
Java
Programming
Coding
Classes
OOP
Instances
Variables
Constructor
Parameters
Loops
Strings
Integers
Conditions
Statements
Setters
Getters
Error Handling
Java Programming: Arrays Of Marks & Circles
Homework Solution
$50.00
Java
Programming
Codes
Computer Science
Algorithms
Arrays
Marks
Circles
Geometry
Mathematics
Radius
Random Numbers
Boundaries
Statements
Loops
Variables
Points
Coordinates
Perimeters
Area
Get help from a qualified tutor
Live Chats