1 / 1100%
public class Player {
// instance variables
private String name;
private double attackStat;
private double blockStat;
// player constructor
public Player(String name, double attackStat, double blockStat) {
this.name = name;
this.attackStat = attackStat;
this.blockStat = blockStat;
}
// player methods
public String getName() {
return name;
}
public double getAttackStat() {
return attackStat;
}
public double getBlockStat() {
return blockStat;
}
public void setAttackStat(double attackStat) {
this.attackStat = attackStat;
}
public void setBlockStat(double blockStat) {
this.blockStat = blockStat;
}
public void printPlayerInfo()
{
System.out.printf("%s (attack = %.2f, block = %.2f)
%n",name,attackStat,blockStat);
}
}
Powered by TCPDF (www.tcpdf.org)
// CSE 110 Fall C
// Assignment 08
// A volleyball game
// 8 hours 11 minutes to complete
Students also viewed