Can someone help fill in the blanks in java please Thanks
Can someone help fill in the blanks in java please? Thanks
/**
* This class deterimes a passing or failing grade for an exam
* This class is a subclass of PassFailActivity
*
* @author ()
* @version ()
*/ (
1) ____________________________________________________________________
{
private int numQuestions; // number of questions
private double pointsEach; //points for each question
private int numMissed; //number of questions missed
/**
* The constructor sets the number of questions, the number of questions missed, and the minimum
* passing score.
* @param questions The number of questions
* @param missed The number of questions missed
* @param minPassing The minimum passing score
*/
(2) public PassFailExam(_______________________________________________________)
{
//Call the superclass constructor
(3) _____________________________________; //declare a local variable for the score
(4) _______________________________________; //Set the numQuestions and numMissed fields
(5) _______________________________________; numMissed = missed;
//Calculate the points for each question and the numeric score for this exam
pointsEach = 100.0 / questions;
numericScore = 100.0 - (missed * pointsEach);
//call the superclass\'s setscore method to set the numeric score
(6) ____________________________________________;
}
/**
* The getPointsEach method returns the number of points each question is worth
*/
public double getPointsEach()
{
return pointsEach;
}
/**
* The getNumMissed method returns the number of questions missed
*/
public int getNumMissed() { return numMissed;
}
}
Solution
PROGRAM CODE:
/**
* This class deterimes a passing or failing grade for an exam
* This class is a subclass of PassFailActivity
*
* @author ()
* @version ()
*/
public class PassFailExam extends PassFailActivity
{
private int numQuestions; // number of questions
private double pointsEach; //points for each question
private int numMissed; //number of questions missed
/**
* The constructor sets the number of questions, the number of questions missed, and the minimum
* passing score.
* @param questions The number of questions
* @param missed The number of questions missed
* @param minPassing The minimum passing score
*/
public PassFailExam(int questions, int missed, double minPassing)
{
//Call the superclass constructor
super();
double numericScore; //declare a local variable for the score
this.numQuestions = questions; //Set the numQuestions and numMissed fields
this.numMissed = missed;
//Calculate the points for each question and the numeric score for this exam
pointsEach = 100.0 / questions;
numericScore = 100.0 - (missed * pointsEach);
//call the superclass\'s setscore method to set the numeric score
setscore(numericScore);
}
/**
* The getPointsEach method returns the number of points each question is worth
*/
public double getPointsEach()
{
return pointsEach;
}
/**
* The getNumMissed method returns the number of questions missed
*/
public int getNumMissed() { return numMissed;
}
}


