using Java Write a grading program for a class with the following grading policies: 1. There are two quizzes, each graded on the basis of 10 points. 2. There is one midterm exam and one final exam, each graded on the basis of 100 points. 3. The final exam counts for 50% of the grade, the midterm counts for 25%, and two quizzes each count for 12.5%. (Do not forget to normalize the quiz scores. They should be converted to a percent before they are averaged in.) Any grades of 90 or more is an A, any grades of 80 or more (but less than 90) is a B, any grades of 70 or more (but less than 80) is a C, any grades of 60 or more (but less than 70) is a D, and any grades below 60 is an F. The program will read in students’ scores from an input file named “input.txt” and output the students’ records to a file named “output.txt”, which consist of student’s ID, name, two quizzes and two exam scores as well as the students’ average score for the course and final letter grade. Define and use a class for a student record. Note: input/output should be done with files.

Database System Concepts
7th Edition
ISBN:9780078022159
Author:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Chapter1: Introduction
Section: Chapter Questions
Problem 1PE
icon
Related questions
Question

using Java 

Write a grading program for a class with the following grading policies:
1. There are two quizzes, each graded on the basis of 10 points.
2. There is one midterm exam and one final exam, each graded on the basis of 100 points.
3. The final exam counts for 50% of the grade, the midterm counts for 25%, and two quizzes each count for 12.5%. (Do not forget to normalize the quiz scores. They should be converted to a percent before they are averaged in.)
Any grades of 90 or more is an A, any grades of 80 or more (but less than 90) is a B, any grades of 70 or more (but less than 80) is a C, any grades of 60 or more (but less than 70) is a D, and any grades below 60 is an F.
The program will read in students’ scores from an input file named “input.txt” and output the students’ records to a file named “output.txt”, which consist of student’s ID, name, two quizzes and two exam scores as well as the students’ average score for the course and final letter grade. Define and use a class for a student record. Note: input/output should be done with files.
The organization for the input file is as follows: The number at the top represents the number of students in a class. Following are students’ records, which consist of 6 items:
 student ID
 name
 quiz 1
 quiz 2
 midterm exam
 final exam

public class Student{

private String studentID;

private String name;

private int quiz1;

private int quiz2;

private int midterm;

private int finalexam; private double avg;

private String grade;

public Student () {

// TODO initialize all the private data members (id="na", n="na", quiz1=0, quiz2=0,

// midterm=0, finalexam=0, avg=0.0, grade="na")

// Here is an example this("na","na", 0, 0, 0, 0, 0.0, "na");

}

public Student (String id, String n, int q1, int q2, int m, int f)

{

// TODO initialize all the private data members with the given arguments, while the grade is "na"

// Here is an example this(id, n, q1, q2, m, f, 0.0, "na");

}

public Student (String id, String n, int q1, int q2, int m, int f, double a, String letterGrade)

{

// TODO initialize all the private data members with the given arguments

// Here is an example studentID=id; name=n; quiz1=q1; quiz2=q2; midterm=m; finalexam=f; avg=a; grade=letterGrade;

}

public void set(String id, String n, int q1, int q2, int m, int f, double a, String g)

{

// TODO set all the private data members with the given arguments

}

public void calcAvg()

{

// TODO Calculate the average grade (avg) based on the student's scores (quiz1, quiz2, midterm and finalexam)

}

public void calcGrade()

{

// TODO Calculate the letter grade (A, B, C, D and F) based on the student's average grade (avg)

}

public String getID()

{

// TODO return studentID

// Here is an example return studentID;

}

public String getName()

{

// TODO return name return "na";

}

public int getQuiz1()

{

// TODO return quiz1 return 0;

}

public int getQuiz2()

{

// TODO return quiz2 return 0;

}

public int getMidterm()

{

// TODO return midterm return 0;

}

public int getFinalexam()

{

// TODO return finalexam return 0;

}

public double getAvg()

{

// TODO calculate the average grade and return the calculated value (avg) return 0.0;

}

public String getGrade()

{

// TODO calculate the letter grade and return the calculated value (grade) return "na";

}

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 2 steps

Blurred answer
Knowledge Booster
Adjacency Matrix
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Database System Concepts
Database System Concepts
Computer Science
ISBN:
9780078022159
Author:
Abraham Silberschatz Professor, Henry F. Korth, S. Sudarshan
Publisher:
McGraw-Hill Education
Starting Out with Python (4th Edition)
Starting Out with Python (4th Edition)
Computer Science
ISBN:
9780134444321
Author:
Tony Gaddis
Publisher:
PEARSON
Digital Fundamentals (11th Edition)
Digital Fundamentals (11th Edition)
Computer Science
ISBN:
9780132737968
Author:
Thomas L. Floyd
Publisher:
PEARSON
C How to Program (8th Edition)
C How to Program (8th Edition)
Computer Science
ISBN:
9780133976892
Author:
Paul J. Deitel, Harvey Deitel
Publisher:
PEARSON
Database Systems: Design, Implementation, & Manag…
Database Systems: Design, Implementation, & Manag…
Computer Science
ISBN:
9781337627900
Author:
Carlos Coronel, Steven Morris
Publisher:
Cengage Learning
Programmable Logic Controllers
Programmable Logic Controllers
Computer Science
ISBN:
9780073373843
Author:
Frank D. Petruzella
Publisher:
McGraw-Hill Education