We have been working very hard since 2009 to facilitate in learning Read More. We can't keep up without your support. Donate.

Assignment No. 04 Semester: Spring 2014 Modern Programming Languages (CS508) Total Marks: 10 Due Date: 22/07/2013

Assignment No. 04
Semester: Spring 2014
Modern Programming Languages  (CS508)


Total Marks: 10


Due Date:  22/07/2013



Please read the following instructions carefully before submitting assignment:


  • You will submit your assignment before or on due date on VU-LMS.
  • Assignment should be completed by your own efforts it should not be copied from internet, handouts or books.
  • You should submit your MS Word File via assignment interface at VU-LMS.
  • Assignment sent via Email will not be replied and accepted/graded in any case.
  • If the submitted assignment does not open or file is corrupt, it will not be graded.
  • You will submit solution only in Microsoft Word File.




To understand and familiarize with Java & C# Language.



For any query about the assignment, contact at cs508@vu.edu.pk or through MDB.

Assignment Questions


Question # 1                                                                                                                              Marks 5     


Out of Java & C# which language is better according to you? Give three strong reasons to support your choice.


Question # 2                                                                                                                              Marks 5     


Let’s say a bank in Pakistan has 450 branches across Pakistan with banks headquarters in Islamabad. Bank wants to take its banking system to online. You have been chosen to make a system for this bank which language will you chose for this system and why. Keep your answer brief.



Views: 715

Replies to This Discussion

Deal Alls start sharing information related to Assignment here????

Assalam u alaikum

bacho ye theory he hai is assignment mai aur kuch ni easy hai ye assignment to

koi to idea share krooooooooooo

specially 2nd question ka

You might have heard of the programming language called Java, since it has gotten a lot of press in recent years, perhaps more than any language ever.  Much of this attention is unfortunately hype, but nevertheless, Java is a good programming language, and has many pedagogical advantages over other languages.

Sun was the company that introduced Java, and understandably it wanted to control its design and evolution.  Unfortunately, Microsoft also wanted a piece of the action, and in particular wanted to change Java in certain ways that suited its needs.  This situation became a legal nightmare, and eventually Microsoft decided that instead of trying to influence Java, it would simply design its own language, which is called C# (pronounced "C sharp").  This is the language that we will be using in CS-112.  It is better than Java in certain ways, but is so similar in most ways that once you have learned how to program in C#, it will be trivial to transfer your knowledge to Java.

You may have also heard of other programming languages, such as BASIC, Visual Basic, C, C++, Ada, Lisp, COBOL, FORTRAN, Haskell, ML, Python, Pearl, JavaScript (which is very different from Java), and others.  Although all of these languages are billed as "general purpose," some are better at certain things than others, and thus one's application often dictates one's choice of a language.  For example, in the Computer Science Department at Yale, FORTRAN is taught in CS-130 (for scientific computing), C in CS-323 (systems programming), Lisp in CS-470 (artificial intelligence), Haskell and ML in CS-429 (functional programming), etc.  Java and C# are usually billed as being good at programming the World Wide Web (WWW), i.e. the Internet.

But it so happens that Java and C# are good general-purpose programming languages suitable for much more than just the Internet.  They use many recent innovations in programming language design, yet are also simple enough to use in a course such as CS-112.  Furthermore, once you know one programming language, it is much easier to learn another.  Java and C# have many attractive characteristics, including:

bullet Simplicity.  Their relative simplicity is their prime attraction as an introductory programming language.
bullet Safety.  Java and C# were designed to be robust.  Their type systems are a major source of this robustness, and the absence of pointers removes one common source of problems.  They also provide exception handling and other methods for creating programs that are less likely to crash.
bullet Cost.  Free implementations of both Java and C# are available.
bullet Cross-platform.  A Java program written for one platform, such as a PC or Mac, will run on any other Java platform automatically.  Java programs are compiled into platform-independent byte-codes.  C# is not quite as platform-independent, but should at least run under Windows and Mac OS-X (but not Linux).
bullet Object-oriented.  In Java and C#, (almost) everything is an object.   In fact, there are no functions or procedures -- just class methods.  C#'s treatment of objects is a bit more uniform than that of Java.
bullet Client-Server and Network support.  Java and C# applets are client-server programs that run on the Internet.
bullet Multimedia support.  The standard Java and C# libraries have support for graphic images, animation, and sound.
bullet Ubiquitous.  Java and C# applications are spreading throughout the Internet.  Students learning these languages can find numerous examples, as well as employment opportunities.
bullet Related to C/C++.  Java and C# are perhaps 75% of C++, and vice versa.  Students who already know C or C++ will have little difficulty learning Java or C#.   Students who learn Java or C# first will have little difficulty picking up C or C++.
Here is my list of 10 reason, which I tell anyone who ask my opinion about learning Java, and whether Java is best programming language in terms of opportunities, development and community support.
1) Java is Easy to learn
Many would be surprised to see this one of the top reason of learning Java, or considering it as best programming language, but it is. If you have steep learning curve, it would be difficult to get productive in short span of time, which is the case with most of professional project. Java has fluent English like syntax with minimum magic characters e.g. Generics angle brackets, which makes it easy to read Java program and learn quickly. Once a programmer is familiar with initial hurdles with installing JDK and setting up PATH and understand How Classpath works, it's pretty easy to write program in Java.
2) Java is an Object Oriented Programming Language
Another reason, which made Java popular is that it's an Object Oriented Programming language. Developing OOPS application is much easier, and it also helps to keep system modular, flexible and extensible. Once you have knowledge of key OOPS concept like AbstractionEncapsulationPolymorphism and Inheritance, you can use all those with Java. Java itself embodies many best practices and design pattern in it's library. Java is one of the few close to 100% OOPS programming language. Java also promotes use of SOLID and Object oriented design principles in form of open source projects like Spring, which make sure your object dependency is managed well by using dependency Injection principle.
3) Java has Rich API
One more reason of Java programming language's huge success is it's Rich API and most importantly it's highly visible, because come with Java installation. When I first started Java programming, I used to code Applets and those days Applets provides great animation capability, which amazes new programmer like us, who are used to code in Turbo C++ editor. Java provides API for I/O, networking, utilities, xml parsing, database connection, and almost everything. Whatever left is covered by open source libraries like Apache Commons, Google Guava and others.
4) Powerful development tools e.g. Eclipse , Netbeans
Believe it or not, Eclipse and Netbeans has played huge role to make Java one of the best programming language. Coding in IDE is pleasure, especially if you have coded in DOS Editor or Notepad. They not only helps in code completion but also provides powerful debugging capability, which is essential for real world development. Integrated Development Environment (IDE) made Java development much easier, faster and fluent. It's easy to search, refactor and read code using IDEs. Apart from IDE, Java platform also has several other tools e.g.. Maven and ANT for building Java applications, decompilers, JConsole, Visual VM for monitoring Heap usage etc.
5) Great collection of Open Source libraries
Open source libraries ensures that Java should be used everywhere. Apache, Google, and other organization has contributed lot of great libraries, which makes Java development easy, faster and cost effective. There are framework like Spring, Struts, Maven, which ensures that Java development follows best practices of software craftsmanship, promotes use of design patterns and assisted Java developers to get there job done. I always recommend to search for a functionality in Google, before writing your own code. There is good chance that, it's already coded, tested and available for ready to use.
6) Wonderful community support
Community is the biggest strength of Java programming language and platform. No matter, How good a language is, it wouldn't survive, if there is no community to support, help and share there knowledge. Java has been very lucky, it has lots of active forums, Stackoverflow, open source organizations and several Java user group to help everything. There is community to help beginners, advanced and even expert Java programmers. Java actually promotes taking and giving back to community habit. Lots of programmers, who use open source, contribute as commiter, tester etc. Expert programmer provides advice FREE at various Java forums and stackoverflow. This is simply amazing and gives lot of confidence to a newbie in Java.
7) Java is FREE
People like FREE things, Don't you? So if a programmer want to learn a programming language, or a organization wants to use a technology, COST is an important factor. Since Java is free from start, i.e. you don't need to pay anything to create Java application. This FREE thing also helped Java to become popular among individual programmers, and among large organizations. Availability of Java programmers is another big think, which makes organization to choose Java for there strategic development.
8) Excellent documentation support - Javadocs
When I first saw Javadoc, I was amazed. It's great piece of documentation, which tells lot of things about Java API. I think without Javadoc documentation, Java wouldn't be as popular, and it's one of the main reason, Why I think Java is best programming language. Not every one has time and intention to look at code to learn what a method do or how to use a class. Javadoc made learning easy, and provide an excellent reference while coding in Java. With advent of IDE, you don't even need to look Javadoc explicitly in browser, but you can get all information in your IDE window itself.
9) Java is Platform Independent
In 1990s, this was the main reason of Java's popularity. Idea of platform independence is great, and Java's tag line "write once run anywhere" was enticing enough to attract lots of new development in Java. This is still one of the reason of Java being best programming language, most of Java applications are developed in Windows environment and run in UNIX platform.
10) Java is Everywhere
Yes, Java is everywhere, it's on desktop, it's on mobile, it's on card, almost everywhere and so is Java programmers. I think Java programmer out number any other programming language professional. Though I don't have any data to back this up, but it's based on experience. This huge availability of Java programmers, is another reason, why organization prefer to choose Java for new development than any other programming language.
Having said that, programming is very big field and if you look at C and UNIX, which is still surviving and even stronger enough to live another 20 years, Java also falls in same league. Though there are lot of talk about functional programming, Scala and other JVM languages, but they need to go a long way to match community, resources and popularity of Java. Also OOPS is one of the best programming paradigm, and as long as it will be there Java will remain solid.

It’s rare that people roll their own HTTP servers. Instead, C# programmers usually use IIS; Java programmers have a few choices, including TomCat. For my tests I’m going to utilize those two servers. For C#, I’m going to specifically use the ASP.NET MVC 4 platform running on IIS 8. I’m going to take two approaches: first, returning a string of HTML from the controller itself; for the second I’ll return a view that includes a date/time lookup.

For the Java tests, I can do two similar approaches. I can have a servlet return some HTML, or I can return the results of a JSP page. These are analogous to the C# controller and View approaches, respectively. I could use the newer Java Faces or any number of other frameworks; if you’re interested, you might try some tests against these other frameworks.

The C# controller simply returns a string of HTML. Running my client test for 2000 iterations sees a time of 991 milliseconds total. That’s still faster than my Java socket version.

The view version of the C# app creates a full standards-compliant HTML page, with an HTML element, head element, meta element, title element, body element, and an inner div element containing the text “The date and time is” followed by the full date and the full time. The date and time are retrieved through the DateTime.Now instance, and filled in dynamically with each request.

Running the client test for 2000 iterations against this view version takes 1804 milliseconds; about twice as long as the direct one. The direct one returns shorter HTML, but increasing the size of the HTML string to match the view version shows no difference; it hovers around the 950-1000 millisecond time. Even adding in the dynamic date and time doesn’t result any noticeable increase. The view version takes twice as long as the controller version, regardless.

Now let’s move on to Java. The servlet is just as simple as the controller in the C# version. It just returns a string that contains an HTML page. Retrieving 2000 instances takes 479 milliseconds. That’s roughly half the time as the C# controller—very fast indeed.

Returning a JSP page is also fast. As with C#, it takes a bit longer than the controller. In this case, retrieving 2000 copies takes 753 milliseconds. Adding in a call in the JSP file to retrieve the date makes no noticeable difference. In fact, the Tomcat server apparently performs some optimization, because after a few more requests, the time to retrieve 2000 copies went all the way down to 205 milliseconds.


These results are quite interesting. Having worked as a professional C# programmer for many years, I’ve been told anecdotally that .NET is one of the fastest runtimes around. Clearly these tests show otherwise. Of course, the tests are quite minimal; I didn’t do massive calculations, nor did I do any database lookups. Our space is limited here, but perhaps another day soon I can add in some database tests and report back. Meanwhile, Java is the clear winner here.

Question #  2 , PHP will be used ...
ub reasons khud search karo


Looking For Something? Search Below

Latest Activity

© 2021   Created by + M.Tariq Malik.   Powered by

Promote Us  |  Report an Issue  |  Privacy Policy  |  Terms of Service