Here is the Assignment:
Call the class described in the assignment GradeDistributionID0000.java
Write a program Ass5ID0000.java ("0000" is your ID) that
creates an instance of GradeDistribution
tests all of the methods from your implementation of the GradeDistribution class.
None of the methods from the GradeDistribution class should prompt a user for input.
All prompting of a user should be done by the Ass5ID0000.java program which should use the set methods from the GradeDistribution class to put data into a GradeDistributionID0000 object.
Your class should have the following methods.
setNumberOfAs()
setNumberOfBs()
setNumberOfCs()
setNumberOfDs()
setNumberOfFs()
getNumberOfAs()
getNumberOfBs()
getNumberOfCs()
getNumberOfDs()
getNumberOfFs()
getTotalNumberOfGrades()
getPerCentA()
getPerCentB()
getPerCentC()
getPerCentD()
getPerCentF()
drawGraph()
------------------------------------
heres what I have so far, but im not sure how to bring the methods and statements from Grade over to the Ass5ID side.
Code://Ass5ID0000
//Main method
import java.util.*;
public class Ass5ID0000
{
public static void main(String[] args)
{
Scanner keyboard = new Scanner(System.in);
System.out.println("how many A's were given?");
GradeDistribution.A = keyboard.nextint();
}
}
Code://Assignment 6
//Grade Distribution
public class GradeDistribution
{
public int A,B,C,D,F;
public void setNumberOfAs()
{
return;
}
public void setNumberOfBs()
{
return;
}
public void setNumberOfCs()
{
return;
}
public void setNumberOfDs()
{
return;
}
public void setNumberOfFs()
{
return;
}
public int getNumberOfAs()
{
return A;
}
public int getNumberOfBs()
{
return B;
}
public int getNumberOfCs()
{
return C;
}
public int getNumberOfDs()
{
return D;
}
public int getNumberOfFs()
{
return F;
}
public int getTotalNumberOfGrades()
{
return A+B+C+D+F;
}
public int getPerCentA()
{
return (A/(A+B+C+D+F)*100);
}
public int getPerCentB()
{
return (B/(A+B+C+D+F)*100);
}
public int getPerCentC()
{
return (C/(A+B+C+D+F)*100);
}
public int getPerCentD()
{
return (D/(A+B+C+D+F)*100);
}
public int getPerCentF()
{
return (F/(A+B+C+D+F)*100);
}
}
