Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Sign In with Facebook Sign In with Google Sign In with OpenID

Categories

We have migrated to a new platform! Please note that you will need to reset your password to log in (your credentials are still in-tact though). Please contact lee@programmersheaven.com if you have questions.
Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Adding sorted data to info string.

UNF_StephUNF_Steph Posts: 13Member
[code]if (event.getActionCommand()=="Write")
//assign empty value to info string variable
writeFile = "";
//start try block
try{
// Set up the output file stream
PrintWriter outFile = new PrintWriter(new PrintStream(new File("GradeReport.txt")));
// Print a header to the output file
outFile.printf("Student Test1 Test2 Test3 Test4 Test5 Average Grade%n");
// for each value in the gradeList arraylist, add the sorted student data (first name, last name, grade) to the info string variable with separated value.
for(int c = 0; c < 15; c++)
{
outFile.printf("%s%t", gradeList.add(fname);
for(int s = 0; s < 5; s++)
{
outFile.printf("%5d%t", gradeList.add(assn);
}
outFile.printf("%7.2f%t", gradeList.add(avg);
outFile.printf("%5c%n", gradeList.add(grade);
}[/code]


I'm pretty sure I'm not even close but I am getting add errors in the add method.

Comments

  • manloomanloo Posts: 2Member
    In your code there seem to be methods which you did not show how they work, but to make it easier for me to help;
    Can you briefly explain what you want to achieve; i.e. describe the format of the inputs required by your program and also describe the desired output. Just make a description in words. This will make it easier to forward a working example.
  • UNF_StephUNF_Steph Posts: 13Member
    Ooopps! I'm sorry.

    Here is the instructions.

    Write a GUI application that will read student scores, calculate student grade, sort student data, and write output into a text file. Application should provide an option for user to upload a text file containing student course data such as first name, last name, and five assignment scores. Program will ask user to browse and select a file. Program should then determine each student grade (see below for grade scale). Application should provide an option to sort the student data including their grade based on their last name. Application should provide an option to produce an output text file, named as
Sign In or Register to comment.