Hi, I just recently started a coding class using BlueJ/JDK 8, I know exactly what i want my code to do, and i already have a basic set up, but I'm stuck. The goal is to have the user input a Tank (The ones that drive around and shoot?) name, and what returns to them are the stats, such as Hitpoints, Tier, Type of tank, etc. Any advice or help would be greatly appreciated! Here's my code:
public class TankCalculator {
private int tier = 1;
private int whatType;
private int whatNation;
private int whatHitpoints;
private int whatPlaystyle;
private int whichTank;
private int MS1;
private int T1;
private int Medium1;
private int LTr;
private int FT;
private int NC31;
private int ROtsu;
private String stats;
public TankCalculator(int Tank) {
whichTank = Tank;
if (whichTank == MS1)stats = 1;
if (whichTank == T1)stats = 2;
if (whichTank == Medium1) stats = 3;
if (whichTank == LTr)stats = 4;
if (whichTank == FT) stats = 5;
if (whichTank == NC31) stats = 6;
if (whichTank == ROtsu) stats = 7;
}
private void setHitpoints(int hitpoints) {
whatHitpoints = hitpoints;
if (whichTank == MS1)return "90 - 100";
if (whichTank == T1)return "105 - 115";
if (whichTank == Medium1) return "130 - 140";
if (whichTank == LTr)return "110 - 130";
if (whichTank == FT) return "105 - 115";
if (whichTank == NC31)return "100 - 110";
if (whichTank == ROtsu)return "100 - 110";
}
private void setType(int type) {
whatType = type;
if (whichTank == MS1)return "Light";
if (whichTank == T1)return "Light";
if (whichTank == Medium1) return "Medium";
if (whichTank == LTr)return "Light";
if (whichTank == FT) return "Light";
if (whichTank == NC31)return "Light";
if (whichTank == ROtsu)return "Light";
}
private void setNation(int nation) {
whatNation = nation;
if (whichTank == MS1)return "USSR";
if (whichTank == T1)return "USA";
if (whichTank == Medium1) return "UK";
if (whichTank == LTr)return "Germany";
if (whichTank == FT) return "France";
if (whichTank == NC31)return "China";
if (whichTank == ROtsu)return "Japan";
}
private void setPlaystyle(int playstyle){
whatPlaystyle = playstyle;
if (whichTank == MS1)return "Brawler";
if (whichTank == T1)return "Mixed";
if (whichTank == Medium1)return "Brawler";
if (whichTank == LTr)return "Sniper";
if (whichTank == FT)return "Sniper";
if (whichTank == NC31)return "Mixed";
if (whichTank == ROtsu)return "Support";
}
public String getStats() {
return stats;
}
}