Ask questions and get helpful answers.

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.

  1. 👍
  2. 👎
  3. 👁
  4. ℹ️
  5. 🚩
2 answers
  1. Please post also your question, for example, what you have done, where is your difficulty, or what kind of help you need.

    1. 👍
    2. 👎
    3. ℹ️
    4. 🚩
  2. 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(......)
    {
    ......
    }
    }

    1. 👍
    2. 👎
    3. ℹ️
    4. 🚩

Answer this Question

Similar Questions

  1. English

    Choose the sentence that is written in active voice. A. The math problems were given to the students. B. The students were taking a math test. C. The math test was given by the instructor. D. The math test grades were given to the students. B

  2. I need help, I'm stuck...what is the correct answe

    The table below shows the scores of a group of students on a 10-point quiz. Test Score Frequency 3 0 4 2 5 2 6 1 7 2 8 3 9 0 10 4 The mean score on this test is: 6.5 The median score on this test is: 7.5

  3. ashford

    Mrs. Orlof teaches two history classes, one in the morning and one in the afternoon. Yesterday she gave the same test to both classes. Anyone who failed the test must take a retest. Since a greater percentage of students who took the morning test failed

  4. Math

    Ten students achieve the following test scores on an exam: 78, 69, 45, 89, 74, 37, 99, 77, 100, 82. What is the interquartile range of these scores?

  5. art music and movement

    Which of the following is an example of direct play? A. The teacher explains that the children are going to build towers with blocks and guides each student with block placement. B. Students find a problem within the classroom and work cooperatively to

  6. computer science

    9.10: Reverse Array Write a function that accepts an int array and the array’s size as arguments. The function should create a copy of the array, except that the element values should be reversed in the copy. The function should return a pointer to the

  7. statistics

    A final exam in sociology has a mean of 72 and a standard deviation of 9.2. If 35 students are randomly selected, find the probability that the mean of their test scores will be greater than 76. Round to tenth of a percent

  8. Math

    1. What type of graph does not show the number of times a response was given? (1 point) box-and-whisker plot line plot stem-and-leaf plot bar graph 2. Which of the following types of information is suited for display on a scatter plot? (1 point)

  9. Statistics

    Scores on the SAT verbal test in recent years follow approximately N(504,111) distribution. What is the proportion of students scoring between 450 and 550? How high must a student score to place in the top 10% of all students taking the SAT? Please show

  10. computer science

    I need help with my Java homework! Write a program that calculates a customer's monthly bill. It should ask the user to enter the letter of the package the customer has purchased (A, B, or C) and the number of hours that were used. It should then display

Still need help?

You can ask a new question or browse existing questions.