Guest User

Untitled

a guest
Jul 18th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. public static void getPrice(String aPrice){
  2.  
  3. double price =0;
  4. try{
  5. price = Double.parseDouble(aPrice);
  6. if (price <=0){
  7. errorMessage += "Price has to be positive\n";
  8. }
  9. }catch(Exception ex){
  10. errorMessage += "Price must be a double.\n";
  11. }
  12. }
Add Comment
Please, Sign In to add comment