Okay so I need to read in the points possible from the user in 5 different categories and store them into an object class called Points
In my main method I have this:
Code
Scanner s = new Scanner(System.in);
System.out.print("Enter in the total possible for Category One : ");
int totalPossiblePointsCategoryOne = Integer.parseInt(s.nextLine());
System.out.print("Enter in the total possible for Category Two : ");
int totalPossiblePointsCategoryTwo = Integer.parseInt(s.nextLine());
System.out.print("Enter in the total possible for Category Three : ");
int totalPossiblePointsCategoryThree = Integer.parseInt(s.nextLine());
System.out.print("Enter in the total possible for Category Four : ");
int totalPossiblePointsCategoryFour = Integer.parseInt(s.nextLine());
System.out.print("Enter in the total possible for Category Five : ");
int totalPossiblePointsCategoryFive = Integer.parseInt(s.nextLine());
How do I store these into a Points object?
my Points class code looks like this:
Code
import java.util.*;
public class Points {
public int totalPossiblePointsCategoryOne;
public int totalPossiblePointsCategoryTwo;
public int totalPossiblePointsCategoryThree;
public int totalPossiblePointsCategoryFour;
public int totalPossiblePointsCategoryFive;
public int totalPossiblePoints;
public Points(int totalPossiblePointsCategoryOne, int totalPossiblePointsCategoryTwo, int totalPossiblePointsCategoryThree, int totalPossiblePointsCategoryFour, int totalPossiblePointsCategoryFive){
this.totalPossiblePointsCategoryOne = totalPossiblePointsCategoryOne;
this.totalPossiblePointsCategoryTwo = totalPossiblePointsCategoryTwo;
this.totalPossiblePointsCategoryThree = totalPossiblePointsCategoryThree;
this.totalPossiblePointsCategoryFour= totalPossiblePointsCategoryFour;
this.totalPossiblePointsCategoryFive = totalPossiblePointsCategoryFive;
this.totalPossiblePoints = totalPossiblePointsCategoryOne + totalPossiblePointsCategoryTwo + totalPossiblePointsCategoryThree + totalPossiblePointsCategoryFour + totalPossiblePointsCategoryFive;
}
public int getTotalPossiblePoints(){
return totalPossiblePoints;
}
}
I need to use the total possible points for each category and store them in an object called points. I then need to add up all of those to get a grand total possible points that I can use to find out weighted scores.
I need to store the weighted scores as well.
weightedCategoryOne = 15% of totalPossiblePoints
weightedCategoryTwo = 15% of totalPossiblePoints
weightedCategoryThree = 30% of totalPossiblePoints
weightedCategoryFour = 10% of totalPossiblePoints
weightedCategoryFive = 30% of totalPossiblePoints.
for example:
totalPossiblePointsCategoryOne = 200
totalPossiblePointsCategoryTwo = 400
totalPossiblePointsCategoryThree = 300
totalPossiblePointsCategoryFour = 75
totalPossiblePointsCategoryFive = 25
then totalPossiblePoints = 1000
Category One = 15% of totalPossiblePoints so weightedCategoryOne = 150
Category Two = 15% of totalPossiblePoints so weightedCategoryTwo = 150
Category Three = 30% of totalPossiblePoints so weightedCategoryThree = 300
Category Four = 10% of totalPossiblePoints so weightedCategoryFour = 100
CategoryFive = 30% of totalPossiblePoints so weightedCategoryFive = 300
after those are stored, i get user's input on playerOnes scores in each category.
so lets say playerOne scored the following:
Category 1: 150 of 200
Category 2: 380 of 400
Cetegory 3: 270 of 300
Category 4: 60 of 75
Category 5: 15 of 25
I need to then figure out the adjusted scores he got based on the weighted category points so for playerOne on category one it would be (150/200)*150 would be his weighted score in category one.
playerOneWeightedScoreCategoryOne = (150/200)*150
playerOneWeightedScoreCategoryTwo = (380/400)*150
playerOneWeightedScoreCategoryThree = (270/300)*300
playerOneWeightedScoreCategoryFour = (60/75)*100
playerOneWeightedScoreCategoryFive = (15/25)*300
playerOneTotalWeightedScore = playerOneWeightedScoreCategoryOne + playerOneWeightedScoreCategoryTwo + playerOneWeightedScoreCategoryThree + playerOneWeightedScoreCategoryFour + playerOneWeightedScoreCategoryFive