loading...

CS508 Modern Programming Languages Assignment 2 Solution

a.   Being a member of a software development team which requires developing software for defense organization, needing to run for more than 20 years. Which of the following programming language you will prefer? Justify your answer with solid arguments.                                                                         Marks: 04

i)                    SNOBAL

ii)                  Ada

iii)                FORTRAN

    

b. Write the program in SNOBOL that outputs the square of numbers between 1 and 15.                Marks: 06

 

Question No. 02:

Ada is one of the strongest and standardized programming languages. Like C/C++, Ada also has rich set of   operators. Consider the following C++ code and write code in Ada programming language to get the similar results by using the same variables, loop etc.                                                                                                   Marks : 10

#include<iostream.h>

main (int argc, char *argv[])

{

int n;

int i=1;

int fact=1;

cout”please enter a number\n”;

cin>>n;

 

if(n<=1)

return 1;

 

while(i<n)

{

fact= fact*i;

i++;

}

coutn”! =”fact;

system(“pause”);

}

Solution:

DOWNLOAD SOLUTION HERE
loading...