The Code-Bin
Links
Home
Add your code!
All Listings
About
Latest Entry
Featured Scripts
Author's Website
Latest Entries
FFMPEG Thumbnail Scr...
PHP, 0.8KB
Jul. 29, 10:24pm
John
Z80 Assembler, 190 bytes
Feb. 17, 3:36am
John
Z80 Assembler, 176 bytes
Sep. 13, 2:19am
John
Z80 Assembler, 77 bytes
Sep. 13, 2:18am
John
Z80 Assembler, 209 bytes
Sep. 13, 2:17am
Bug fixer extraordinaire...
Posted by: Wesley Hall | March 29, 2010 @ 3:22pm
Java 5 Code
[
Download
]
import java.math.BigInteger; import java.util.*; public class Divider { public static void main(String[] args) throws Exception { System.out.println("To get A divided by B��"); BigInteger firstNumber = readNumber("Enter A�.:"); BigInteger secondNumber = readNumber("Enter B�.."); System.out.println(firstNumber + " divided by " + secondNumber + " is�.."); BigInteger[] resultAndRemainder = firstNumber.divideAndRemainder(secondNumber); System.out.println(resultAndRemainder[0]); System.out.println("and the remainder is...."); System.out.println(resultAndRemainder[1]); System.out.println("Thanks for playing!"); } private static BigInteger readNumber(String message) throws Exception { System.out.println(message); Scanner scanner = new Scanner(System.in); try { return scanner.nextBigInteger(); } catch(InputMismatchException e) { System.err.println("I will get back to you when we figure out alphabetic division! Frankly, cant be bothered with you!!! Buh bye!"); System.exit(1); } return null; } }
Syntax Highlighting
[
Open in new window
]
Author Comments
A simple divider app to fix Sophia's bug!
Rating
4.78 / 8
60 Votes