Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart

Saturday 7 April 2012

CS508 assignment 1 spring 2012

Modern Programming Languages (CS508)
SPRING 2012

Assignment No. 1
Total Marks: 20 Dead line: April 13, 2012
Uploading instructions.
Your assignment must be in .doc format.(Any other formats like scan images,

PDF, Zip, rar, bmp, docx etc will not be accepted)
Save your assignment with your ID (e.g. bc020200786.doc).
No assignment will be accepted through email.
Do not put any query at MDB about this assignment, if you have any query then

email at

Purpose of Assignment
Intended purpose of this assignment is to give students an exercise that can facilitate them

while working in any professional software development environments. After attempting

this assignment students will be able to:
Familiarize with the core concept of choosing language Paradigms
Learn language evaluation Factors and techniques.
Students will get comprehensive understanding of an important programming
language concept i.e Orthogonality.
Application:

AlstraSoft E-Friends
Scenario:
Suppose you are developing an online first-degree friendship building social network for
E-friends
application at Alstrasoft Pvt Ltd that strive to be the premier provider of webbased
software solutions for businesses worldwide. As a web development and software
company, Alstrasoft specialize mainly in web design and software programming.
Evaluation:
Now being a senior Software Developer at this company where portability is the prime
concern of your management, you are required to answer following questions keeping in
view the above constraints.
a)
Which programming language among Java and C++ will be preferred by you in this
programming paradigm keeping portability a major concern for your company? State
your answer with solid reasons?
[5]

b)
Beside portability what other factors should be considered for language of choice in
above scenario, to give better productivity in e-Business and to enable customers to start
their own online business with ease and generate an extra stream of revenue.
[10]

c)
While working in same programming environment you came across following piece of
code implemented in
C++.from the following code infer if it is following the principle of orthogonality or not? If NOT then explain with solid reason.
[5]

#include <iostream.h>

#include <stdio.h>

# include <conio.h>

using namespace std;

int main() {

char a[80];

char b[80]; int i, j;

cout << "Enter a sentence: ";

gets(a); // Read a token at a time from the string.

for(i=0;; i++) { /* Read characters until either a space or the null

terminator is encountered. */

for(j=0; a[i]!=' ' && a[i]; j++, i++)

b[j] = a[i];

b[j] = '\0'; // null terminate the token

b[j] = '\0'; // null terminate the token

cout << b << '\n';

if(!a[i])

break;

}

getch();

return 0;

}



2 comments:

“You can't change the past, but you can ruin the present by worrying about the future”