Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static void getPrice(String aPrice){
- double price =0;
- try{
- price = Double.parseDouble(aPrice);
- if (price <=0){
- errorMessage += "Price has to be positive\n";
- }
- }catch(Exception ex){
- errorMessage += "Price must be a double.\n";
- }
- }
Add Comment
Please, Sign In to add comment