Sunteți pe pagina 1din 6

1. Pseudocode is made up of statements written to depict the steps, in the correct sequence, required to solve a specific problem.

By being a type of structured English for describing algorithms,it allows the designer to focus on the logic of the algorithm without being distracted by details of language syntax and describes the entire logic of the algorithm so that implementation becomes a rote mechanical task of translating line by line into source code. Therefore, its purpose is to provide a high-level description of an algorithm which facilitates analysis and eventual coding (should it be deemed to be a \good" algorithm) but at the same time suppresses many of the details that vanish with asymptotic notation. 2. a) Machine Language: The machine language is the internal language of the computer system. It is a difficult programming language to handle by any humans. It is usually made up of a binary string of 0s and 1s that is understood by the machine to follow any instructions. Infact, we can say that the machine can only recognize these 0s and 1s and nothing else. So, it is a language of the lowest degree made for machines only. Programmes therefore prefers to use either a highlevel programming language or an assembly language to deliver various instructions by translating it to machine understandable codes known as machine codes. Assembly Language: Assembly language is a second generation programming language used in the computer systems. In assembly language, a programmer uses symbolic instructions instead of machine language instructions and descriptive names for data items and memory location. An assembly language program is written according to strict rules and then translated by an assembler into

machine code. It is machine dependant language hence it is not portable. It has very less restrictions and also features high interaction between the operating system and the hardware thus enabling to write easy hardware dependant programs. The various symbolic notations used in the assembly language is called mnemonics. b)Because it is extremely low level, assembly language can be optimized extremely well. Therefore assembly language is used where the utmost performance is required for applications. Assembly language is also useful for communicating with the machine at a hardware level. For this reason, it is often used for writing device drivers.A third benefit of assembly language is the size of the resulting programs. Because no conversion from a higher level by a compiler is required, the resulting programs can be exceedingly small. For this reason, assembly language has been a language of choice for the demo scene. This involves coders writing extremely small programs which show off their creative and technical abilities to other members of the scene. Assembly language key benefits:

Speed. Assembly language programs are generally the fastest programs around. Space. Assembly language programs are often the smallest. Capability. You can do things in assembly which are difficult or impossible in HLLs. Knowledge. Your knowledge of assembly language will help you write better programs, even when using HLLs.

3.a) C++ is an extension of C language. This means that you can not only use the new features introduced with C++ but can also use the power and efficiency of C language. C and C++ are no more language for writing compilers and other languages, these general purpose languages are used worldwide in every field. Here is a list of differences between c and c++ .The main difference between C and C++ is that C++ is object oriented while C is function or procedure oriented. Object oriented programming paradigm is focused on writing programs that are more readable and maintainable. It also helps the reuse of code by packaging a group of similar objects or using the concept of component programming model. It helps thinking in a logical way by using the concept of real world concepts of objects, inheritance and polymorphism. It should be noted that there are also some drawbacks of such features. For example using polymorphism in a program can slow down the performance of that program. On the other hand, functional and procedural programming focus primarily on the actions and events, and the programming model focuses on the logical assertions that trigger execution of program code. b) Why use C++ Stronger typing The type system in C++ is stronger than in C. This prevents many common programming errors - coupled with the next very important feature, the stronger type system even manages not to be an inconvenience.

Parameterized types The template keyword allows the programmer to write generic (type-agnostic) implementations of algorithms. Where in C, one could write a generic list implementation . Not only does the C++ implementation prevent common programming errors (like putting an element of the wrong type on the list), it also allows better optimization by the compiler . The difference being, that for example sorting an array of integers, would, in the C case, require a function call for every single compare, whereas the C++ implementation would allow the compiler to inline the integer comparison calls, as the actual sort routine is instantiated at compile time, automatically by the compiler, with the correct types inserted in the template arguments. A bigger standard library C++ allows the full use of the C standard library. This is very important of course, as the C standard library is an invaluable resource when writing real world programs. However, C++ includes the Standard Template Library. The STL contains a number of useful templates, like the sort routine above. It includes useful common data structures such as lists, maps, sets, etc. Like the sort routine, the other STL routines and data structures are "tailored" to the specific needs the programmer has - all the programmer has to do is fill in the types. Of course, the STL is no silver bullet - but it does provide a great help very often, when solving general problems. How often have you implemented a list in C? How often would an RB-tree have been a better solution, if only you had had the time to do it? With the STL you do not need to make such compromises - use the tree if it's a better fit, it's as easy as using the list.

When? First of all, the most important aspect to choose any programming language are its knowledge by the developers, and the existence of code base to maintain. Secondary factors are the availability of good tools and good libraries for the language, and a large and active community of developers. 4. a) Java was originally designed to use on things like cellular phones but quickly gained a reputation as a viable way to produce animated webpages on the internet. It boasts simplicity in its use, security, portability in terms of the type of operating system it's being used on, and reliability. b) Java features Java Virtual Machine (JVM) an imaginary machine that is implemented by emulating software on a real machine provides the hardware platform specifications to which you compile all Java technology code Bytecode a special machine language that can be understood by the Java Virtual Machine (JVM) independent of any particular computer hardware, so any computer with a

Java interpreter can execute the compiled Java program, no matter what type of computer the program was compiled on Garbage collection thread responsible for freeing any memory that can be freed. This happens automatically during the lifetime of the Java program. programmer is freed from the burden of having to deallocate that memory themselves Code security is attained in Java through the implementation of its Java Runtime Environment (JRE). JRE runs code compiled for a JVM and performs class loading (through the class loader), code verification (through the bytecode verifier) and finally code execution Class Loader responsible for loading all classes needed for the Java program adds security by separating the namespaces for the classes of the local file system from those that are imported from network sources After loading all the classes, the memory layout of the executable is then determined. This adds protection against unauthorized access to restricted areas of the code since the memory layout is determined during runtime Bytecode verifier tests the format of the code fragments and checks the code fragments for illegal code that can violate access rights to objects

S-ar putea să vă placă și