Guest User

Untitled

a guest
May 24th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.46 KB | None | 0 0
  1. public class AMPMClock extends Clock {
  2.  
  3. private boolean choice;
  4.  
  5.  
  6.  
  7. public void setAMPM(boolean itson) {
  8. this.choice = itson;
  9. }
  10.  
  11.  
  12. public String toString(){
  13. if (choice == true) {
  14. if (wra > 12){
  15. wra = wra - 12;
  16. return (zero(wra)+":"+zero(lepta)+":"+zero(defter) + "am");
  17. }
  18. else{
  19. return (zero(wra)+":"+zero(lepta)+":"+zero(defter) + "pm");
  20. }
  21. }
  22. else{
  23. return zero(wra)+":"+zero(lepta)+":"+zero(defter) ;
  24. }
  25. }
  26.  
  27. }
Add Comment
Please, Sign In to add comment