Having some issues with my homework.
So i posted my code here yesterday and you all helped out alot, I really appreciate it. I am supposed to use integers for the user to enter an amount of bytes into the input, and it is supposed to output how many GBs, MBs, KBs, and bytes are in the amount of bytes that was entered. Here is my code so far but I am having a few errors.
I used the division and modulas like someone suggested (I figured that was how you were supposed to do it, and it runs and works for some inputs, say i entered 1073742849 bytes, then it will give me back 1 GB. but if enter a bigger number like 2500000000, it gives me this error.
"Exception in thread "main" java.util.InputMismatchException: For input string: "2500000000"
Also something is wrong with the integer variable "mbs" bc when I enter a number to check how it is working, for example i would enter 1049600 bytes then it will give me an error and return this.
"Exception in thread "main" java.lang.ArithmeticException: / by zero
Java Result: 1"
Something about dividing by zero? Anyway thanks for everyone's help.