Java

posted by .

create a java program that accepts students names, and test scores from a file, and displays theri name, average score and letter grade to the screen.

  • Java -

    Please post also your question, for example, what you have done, where is your difficulty, or what kind of help you need.

  • Java -

    class LastnameA6
    {
    static final NUMBEROFSTUDENTS = 5;
    public static void main(String[] args)
    {
    //variable declaration
    int test1, test2, test3, test4, test5; // variables to hold the values for the five test scores
    double courseAvg = 0; // the average course score for each student
    double classAvg = 0; // the average score for the whole class
    String name; // variable to hold student name
    char grade; // the grade scale 'A', 'B', 'C', 'D', 'F'

    // add code here for the input(Assign7Input.txt) and output files (Assign7Output.txt)
    ......

    // print the heading to the output text file.
    System.out.println ("Student Test1 Test2 Test3 Test4 Test5 Average Grade");

    for (int i = 0; i < NUMBEROFSTUDENTS; i++)
    {
    // add your code here to read the input and do the calculation
    { if
    (grade <= 59)grade = F;
    else
    if (grade >= 60 && grade <=69)grade = D;
    else
    if (grade >=70 && grade <=79)grade = C;
    else
    if (grade >= 80 && grade <=89)grade = B;
    else
    if (grade >= 90 && grade <=100)grade = A;
    // the following are from method call which to be completed later
    courseAve = calculateAverage (test1, test2, test3, test4, test5);
    grade = calculateGrade(courseAvg);

    ......

    }

    // add your code to calculate and output the class average
    ......

    }

    // Method 1: calculate the average grade from the five test scores
    ...... calculateAverage( ...... )
    {
    ......
    }

    // Method 2: calculate the grade scale 'A', 'B', 'C', 'D', 'F'
    ......calculateGrade(......)
    {
    ......
    }
    }

Respond to this Question

First Name
School Subject
Your Answer

Similar Questions

  1. Computer Programing & Logic Design

    Submit pseudocode and a flowchart for the following programming exercise: Test Average and Grade Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average …
  2. java

    Write a java application that finds the smallest of several integers. Prompt the user for the number of integers that will be input, then prompt the user for that number of integers. Evaluate the integers to determine the smallest …
  3. Java Programming

    I'm new to Java and I'm not sure how to write the source code for this problem I got in class... Write a java program using the while and if statement that will accept ten student grades and that will display the sum of the grades, …
  4. Java Programming

    How to create a two dimensional arrays that stored the score of 3 subjects of 2 semesters, and score will added by users and program should do - Calculate the average scores of each semester - The maximum score of each semester - The …
  5. programming

    Professor Merlin has asked you to help him. He has 5 students who have taken four tests. He wants a program where he can enter the students name and their four test scores. After entering all 5 students then he wants a grade report …
  6. JAVA PROGRAMMING

    Create a java program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as total point value per grade available.
  7. java programming

    Create a java program that will calculate the current grade in a classroom. The program should ask for 5 grades as well as total point value per grade available.
  8. java programming

    Test Average and Grade Write a program that asks the user to enter five test scores. The program should display a letter grade for each score and the average test score. Write the following methods in the program: • calcAverage—This …
  9. Java

    Need help asap. You are given a list of students' names and their test scores. Design an algorithm that does the following: a. Calculates the average test scores. b. Determines and print the names of all the students whose test score …
  10. Programming Java

    I am learning Java in programming right now. I need to write a program that should have an output like this: The program says "Type ten names". Then ten names sould be typed a person. Then the program chooses a random name from the …

More Similar Questions