ClubEnsayos.com - Ensayos de Calidad, Tareas y Monografias
Buscar

Tic2, Integradora etapa 1


Enviado por   •  25 de Septiembre de 2018  •  Trabajos  •  368 Palabras (2 Páginas)  •  76 Visitas

Página 1 de 2

[pic 1][pic 2]


  1. Do the algorithm and flowchart which print the series of numbers from 1 to 10 and also when it finished, print its respective sum.[pic 3]
  1. Start
  2. Print series from 1 to 10 and its addition at the end
  3. Initialize the accumulating variable of numbers in zero
  4. Verify the numbers of the serie (the number is less than or equal to 10) then,
  5. Yes: Print its respective sum
  6. No: Add the 1 to the accumulating variable of the number N= N + 1, go to step 4
  7. End

[pic 4][pic 5][pic 6][pic 7][pic 8][pic 9][pic 10][pic 11][pic 12][pic 13][pic 14][pic 15][pic 16][pic 17][pic 18][pic 19][pic 20][pic 21][pic 22][pic 23][pic 24][pic 25][pic 26]

b) Do the algorithm and flowchart that calculate and print the Factorial of a number.

  1. Start
  2. Capture the number (n)
  3. Identify if the number is equal to zero.
  4. True: its factorial is 1.
  5. False: factorial is 1.
  6. Initialize the accumulator variable in 1 (a = 1).
  7. Take the new value of the factorial, calculating the factorial that you have by the accumulator variable (F = f * a).
  8. Add one to the accumulator variable and verify that the result is less than or equal to the number that was chosen (n).
  9. Perform the same operations as point 7 but now with the new accumulator variable.
  10. Add 1 to the accumulator variable and verify that it is equal to the same number multiplied by 1    (a = a * 1).
  11. Make point 9.
  12. Perform the same procedures from point 8.
  13. If the accumulator variable is greater than the number that was chosen (n), the factorial of the number that opted was found.
  14. Print the factorial
  15. End.[pic 27]

[pic 28]

        [pic 29][pic 30][pic 31][pic 32][pic 33][pic 34][pic 35][pic 36][pic 37][pic 38][pic 39][pic 40][pic 41][pic 42][pic 43][pic 44][pic 45][pic 46][pic 47][pic 48][pic 49][pic 50][pic 51][pic 52][pic 53][pic 54]

...

Descargar como (para miembros actualizados) txt (2 Kb) pdf (209 Kb) docx (259 Kb)
Leer 1 página más »
Disponible sólo en Clubensayos.com