Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- note
- description : "practica1ej2 application root class"
- date : "$Date$"
- revision : "$Revision$"
- class
- APPLICATION
- inherit
- ARGUMENTS
- create
- make
- feature {NONE} -- Initialization
- make
- -- Run application.
- do
- --| Add your code here
- print ("Result: %N"+concatenacion("HOLA","MUNDO"))
- end
- concatenacion (cadena1: STRING;cadena2: STRING): STRING
- local
- aux : STRING
- do
- if (cadena1.is_empty)
- then Result := cadena2 --caso base 1
- else
- if (cadena2.is_empty)
- then Result := cadena1 --caso base 2
- else --caso inductivo
- aux:= cadena1.item (1).out+cadena2.item (1).out
- cadena1.remove_head (1)
- cadena2.remove_head (1)
- Result := aux+concatenacion(cadena1,cadena2)
- end
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement