Ada95 Program To Implement The Euler’s 2nd Iteration Method-Aeronautical Engineering And Computer Programming-Assignment, Exercises of Computer Engineering and Programming

This assignment is for Computer Programming course. It was assigned by Prof. Anurag Negi at KIIT University. It includes: For, Program, Computer, Unified, Code, Ada95, Loop, While, Code, Implement, End

Typology: Exercises

2011/2012

Uploaded on 07/20/2012

savitri_85
savitri_85 🇮🇳

4

(5)

70 documents

1 / 1

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Problem C11. (Unified Computers and programming)
1. What is the output of the code fragment in Figure 1?
2. Write an Ada95 program to implement the Euler’s 2nd order integration method.
Turn in a hard copy of your algorithm and code listing and an electronic copy of
your code.
3. Write an Ada95 program to accept 10 numbers from the user and find the average
of the numbers. Implement your code using the WHILE – LOOP construct. Turn
in a hard copy of your algorithm and code listing, and an electronic copy of your
code.
Hint: Compute the sum every time the user enters a number and the average
outside the loop.
Count := 1;
for I in 1 .. 10 loop
if I MOD 2 = 0 then
for J in 1 .. 10 loop
Count:= Count + 2;
end loop;
else
for J in 1 .. 5 loop
Count := Count - 1;
end loop;
end if;
end loop;
Figure 1. Code Fragment
docsity.com

Partial preview of the text

Download Ada95 Program To Implement The Euler’s 2nd Iteration Method-Aeronautical Engineering And Computer Programming-Assignment and more Exercises Computer Engineering and Programming in PDF only on Docsity!

Problem C11. (Unified Computers and programming)

  1. What is the output of the code fragment in Figure 1?
  2. Write an Ada95 program to implement the Euler’s 2nd^ order integration method. Turn in a hard copy of your algorithm and code listing and an electronic copy of your code.
  3. Write an Ada95 program to accept 10 numbers from the user and find the average of the numbers. Implement your code using the WHILE – LOOP construct. Turn in a hard copy of your algorithm and code listing, and an electronic copy of your code.

Hint : Compute the sum every time the user enters a number and the average outside the loop.

Count := 1; for I in 1 .. 10 loop if I MOD 2 = 0 then for J in 1 .. 10 loop Count:= Count + 2; end loop; else for J in 1 .. 5 loop Count := Count - 1; end loop; end if; end loop;

Figure 1. Code Fragment

docsity.com