Quote:

The amount of happiness that you have depends on the amount of freedom you have in your heart
Showing posts with label CS508 Assignments. Show all posts
Showing posts with label CS508 Assignments. Show all posts

Friday, 13 April 2012

CS508 assignment 1 spring 2012 solution


CS508                           Assignment 1

Solution Question – 1

Portability:

Java using VM (virtual Machine) between the application and Real Environment (computer+ operating system). We can run the program everywhere. Each kind of computer has its own instruction set. While some processors include the instructions for their predecessors, it's generally true that a program that runs on one kind of machine (computer) won't run on another. Add in the services provided by the operating system, which each system describes in its own unique way, and you have compatibility problem. In general, you can't write and compile a program for one kind of system and run it on any other without a lot of work. In other words, most programs are not portable JAVA is an architecture neutral language. As stated in article1, the JAVA compiler generates JAVA Virtual Machine codes instead of machine codes specific to the computer system we are using.
 Question – 2

Portability Factors:


Portability Factors
For Java
Platforms
Growing
Built-in-Libraries
Extensive
Third Party Libraries
Extensive
Standardization
High
Commercial Use
Extensive
Runtime Behavior
Defined
Safe Programming
Yes






Question 3- Solution:



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;

}