Docsity

Ada95 Program To Iteratively Compute The Factorial-Computer Programming-Assignment, Exercises of Computer Engineering and Programming

Toggle sidebar
bg1
Problem C12. (Unified Computers and programming)
1. Write an Ada95 program to iteratively compute the factorial of a number (get
the number from the user). Turn in a hard copy for your algorithm and code
listing, and an electronic copy of your code.
2. Does your program work for all possible inputs? List the instances in which it
fails.
3. Write a recursive Ada95 program to compute the first ‘N’ Fibonacci numbers,
where ‘N’ is user defined. Turn in a hard copy for your algorithm and code
listing, and an electronic copy of your code.
Hint: The Fibonacci numbers are the numbers of the series 1, 1, 2, 3, 5, 8, 13, 21, …
What is the mathematical formula used to compute the numbers? Do you need more
than one function/ procedure?
docsity.com

Partial preview of the text

Download Ada95 Program To Iteratively Compute The Factorial-Computer Programming-Assignment and more Exercises Computer Engineering and Programming in PDF only on Docsity!

Problem C12. (Unified Computers and programming)

  1. Write an Ada95 program to iteratively compute the factorial of a number (get the number from the user). Turn in a hard copy for your algorithm and code listing, and an electronic copy of your code.
  2. Does your program work for all possible inputs? List the instances in which it fails.
  3. Write a recursive Ada95 program to compute the first ‘N’ Fibonacci numbers, where ‘N’ is user defined. Turn in a hard copy for your algorithm and code listing, and an electronic copy of your code.

Hint : The Fibonacci numbers are the numbers of the series 1, 1, 2, 3, 5, 8, 13, 21, … What is the mathematical formula used to compute the numbers? Do you need more than one function/ procedure?

docsity.com