ÿþf u n c t i o n   C o n v e r t T o D e c i m a l D e g r e e ( D D M M )  
 {  
          
 	 v a r   d e g r e e s         =   p a r s e I n t ( D D M M ) ;  
 	 v a r   t e m p M i n u t e s   =   D D M M   -   d e g r e e s ;  
 	 v a r   m i n u t e s         =   p a r s e I n t ( t e m p M i n u t e s   *   1 0 0 ) ;  
 	 v a r   s e c o n d s         =   0 ;  
 	 v a r   d e c D e g r e e s   =   0 . 0 ; 	  
  
 	 i f ( d e g r e e s   <   0 . 0 )  
 	 {  
 	 	 a l e r t ( ' T h e   d e g r e e s   s h o u l d   b e   e x p r e s s e d \ n w i t h   a   z e r o   o r   a   p o s i t i v e   n u m b e r . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( m i n u t e s   <   0 . 0 )  
 	 {  
 	 	 a l e r t ( ' T h e   m i n u t e s   s h o u l d   b e   e x p r e s s e d \ n w i t h   a   z e r o   o r   a   p o s i t i v e   n u m b e r . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( s e c o n d s   <   0 . 0 )  
 	 {  
 	 	 a l e r t ( ' T h e   s e c o n d s   s h o u l d   b e   e x p r e s s e d \ n w i t h   a   z e r o   o r   a   p o s i t i v e   n u m b e r . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( d e g r e e s   ! =   M a t h . f l o o r ( d e g r e e s ) )  
 	 {  
 	 	 a l e r t ( ' T h e   d e g r e e s   s h o u l d   b e   a   n u m b e r . \ n T h a t   n u m b e r   s h o u l d   h a v e   n o   d e c i m a l . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( m i n u t e s   ! =   M a t h . f l o o r ( m i n u t e s ) )  
 	 {  
 	 	 a l e r t ( ' T h e   m i n u t e s   s h o u l d   b e   a   n u m b e r . \ n T h a t   n u m b e r   s h o u l d   h a v e   n o   d e c i m a l . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( s e c o n d s   ! =   M a t h . f l o o r ( s e c o n d s ) )  
 	 {  
 	 	 a l e r t ( ' T h e   s e c o n d s   s h o u l d   b e   a   n u m b e r . \ n T h a t   n u m b e r   s h o u l d   h a v e   n o   d e c i m a l . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( d e g r e e s   > =   3 6 0 . 0 )  
 	 {  
 	 	 a l e r t ( ' T h e   d e g r e e s   s h o u l d   b e   l e s s   t h a n   3 6 0 . ' ) ;  
 	 	  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( m i n u t e s   > =   6 0 . 0 )  
 	 {  
 	 	 a l e r t ( ' T h e   m i n u t e s   s h o u l d   b e   l e s s   t h a n   6 0 . ' ) ;  
 	 	  
 	 	 r e t u r n ;  
 	 }  
  
 	 i f ( s e c o n d s   > =   6 0 . 0 )  
 	 {  
 	 	 a l e r t ( ' T h e   s e c o n d s   s h o u l d   b e   l e s s   t h a n   6 0 . ' ) ;  
  
 	 	 r e t u r n ;  
 	 }  
  
 	  
 	 d e c D e g r e e s   =   d e g r e e s   +   ( m i n u t e s   *   ( 1 . 0   /   6 0 . 0 ) )   +   ( s e c o n d s   *   ( 1 . 0   /   3 6 0 0 . 0 ) ) ;  
  
 	 r e t u r n   R o u n d N u m b e r ( d e c D e g r e e s , 2 ) ;  
 }  
  
 f u n c t i o n   R o u n d N u m b e r ( n u m ,   d e c )   {  
 	 v a r   r e s u l t   =   M a t h . r o u n d ( n u m * M a t h . p o w ( 1 0 , d e c ) ) / M a t h . p o w ( 1 0 , d e c ) ;  
 	 r e t u r n   r e s u l t ;  
 } 
