albertohilal

Clase 4 Ejercicio 3.2.26

Sep 3rd, 2017
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.66 KB | None | 0 0
  1. /*Escribir un procedimiento PlantarYFertilizar que, reutilizando
  2. la idea del ejemplo al comienzo del subapartado 3.2.3,
  3. plante una flor si no hay ninguna,
  4. y fertilice las flores que haya
  5. (ya sea que fueron recien colocadas o
  6. ya existıan).
  7. bolita roja flor
  8. bolita negra fertilizante
  9. Nombre adecuadamente sus subtareas utilizando procedimientos y
  10. funciones auxiliares de manera conveniente.*/
  11.  
  12. function hayFlor(){
  13. return (hayBolitas(Rojo))
  14. }
  15. function hayFertilizante(){
  16. return (hayBolitas(Negro))
  17. }
  18.  
  19. procedure PlantarYFertilizar(){
  20.  
  21. if (not hayFlor()==True){
  22. Poner(Rojo)
  23. Poner(Negro)
  24. }
  25. else
  26. { Poner(Negro)}
  27. }
  28.  
  29. procedure Main(){
  30. PlantarYFertilizar()
  31. }
Advertisement
Add Comment
Please, Sign In to add comment