Hi i am trying to make a program that gets 2 inputs from a user(command line program) and calculates them with some static information and gives the user the result.
Guess its better if i explain what the program is for first...
i play an MMORPG game kinda like final fantasy and im trying to make a damage calculator...i want the user to put in their attack or matk and then the skill they will use to hit the target and the program should calculate the dmg they will cause
this is the equation that the program will perform to get the result
(Atk/Matk * 1.4 + Skill increase - 200 * 0.98)
so what i need to do is have the user put in their atk/matk number and their skill(to figure out the increase that should be applied and i already know the numbers for the skills) but there is like 30 or so skills that you can choose from
so here is the code i have so far
package DamageCalc; import java.util.Scanner; public class DmgCalc { public static void main (String args[]) { int Attack; Scanner input = new Scanner(System.in); System.out.println("Enter your Atk/Matk?"); Attack = input.nextInt(); System.out.println("Your Attack is: " + Attack); } }
i just put the your attack is part so i could see if i did the scanner part right
so my question is for all the 30 skills i think i could do if/then statements for all right? but what im wondering is there an easier way to do the skills than to have 30 if/then statements? im not looking for the exact code to finish it just more about what i could learn to make it smaller than 30 if/then statements(if that will work).
edit: sorry i forgot to mention that each skill has a different increase
thanks for any help you can provide and i hope i posted this in the right section