dadominator227 0 Newbie Poster

Hi im new here and im desperate because my java program is due at midnight and im stuck. my computer froze at one point and i lost a lot of info and i thought i put the info back in but now it wont compile.here is the assignment:

Write a java application that prompts the user to input test scores. Calculate the average of the scores and print out a listing of the scores that were above average.

Notes:
1. Use JTextArea for output.
2. Use BufferedReader or the Scanner class for input.
3. Your program should not crash if invalid data is entered.
3. Use an ArrayList to store the input values.
4. The output should be labeled.

here is what i have so far:

import javax.swing.*;
import java.util.ArrayList;


import java.util.Scanner;


public class DinkinsD_P1
{
public static void main(String[]args)
{



String input;
int x;      // input by user
String moreNumbers ="yes";                              // to control the input loop
double avg;
int count = 0;
String no;
String yes;
String output2;



String moreTest ="yes";
String output = "\t\t A Demo of JTextArea \n\n" ; //heading for the output


JTextArea outputTextArea = new JTextArea( 20,40 );// defines a output area with a height of 20
// and length of 40


JScrollPane scroller = new JScrollPane(outputTextArea);//allows for a scroller to be used so
//all the output can be seen


Scanner scan = new Scanner (System.in);


count = 0;
while ( moreTest.equalsIgnoreCase("yes") )
{
x = 0;


System.out.println("Enter a test score:");
x = scan.nextInt();


System.out.println (" Are ther more numbers to input?");
moreTest = scan.next();
}


outputTextArea.setText (output);



}
}

can anybody help me with a source code to make this work because i only have an hour and a half left b4 points are taken off for turning it in late.thanks....

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.