Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*Escribir un procedimiento PlantarYFertilizar que, reutilizando
- la idea del ejemplo al comienzo del subapartado 3.2.3,
- plante una flor si no hay ninguna,
- y fertilice las flores que haya
- (ya sea que fueron recien colocadas o
- ya existıan).
- bolita roja flor
- bolita negra fertilizante
- Nombre adecuadamente sus subtareas utilizando procedimientos y
- funciones auxiliares de manera conveniente.*/
- function hayFlor(){
- return (hayBolitas(Rojo))
- }
- function hayFertilizante(){
- return (hayBolitas(Negro))
- }
- procedure PlantarYFertilizar(){
- if (not hayFlor()==True){
- Poner(Rojo)
- Poner(Negro)
- }
- else
- { Poner(Negro)}
- }
- procedure Main(){
- PlantarYFertilizar()
- }
Advertisement
Add Comment
Please, Sign In to add comment