1. Compare two criteria or characteristics using Visual Basic and Visual C++.
Readability. Visual Basic is a programming language that can be easily read. Most constructs resemble plain English words and phrases. It also has low feature multiplicity. To increment a variable one must write: i = i + 1. Visual C++ has several ways of doing it though with slightly different meanings: i = i + 1 or i +=1 or i++ or ++i. This lowers the readability of Visual C++. Visual Basic still retains the 'goto' statement which allows for unconditional jump to a labelled code line. If misused, it can lead to unstructured programming and lower readability. Overall, Visual Basic has higher readability than Visual C++.
Writability. Visual C++ allows for more expressivity while writing code. As in the previous example, incrementing a value can be done in several different ways. Implementing a binary tree in Visual C++ comes natural with the use of pointers. While this can be accomplished in Visual Basic with the use of references, it is more cumbersome. Overall, Visual C++ has higher writability than Visual Basic.
2. Give one advantage and one disadvantage for each of the following language characteristics:
◦ Generality – advantage: a language with high generality can be used in a wide range of applications; disadvantage: a language with high generality may be more difficult to use in a specific application domain than a language build with that domain in mind
◦ Aliasing – advantage: allows for more flexibility in writing code; disadvantage: may increase the chance for program errors when the value pointed to by two references is changed.
◦ Type Checking – advantage: if type checking is done at compile time, possible errors are detected ...
... middle of paper ...
...r op;
Expression term1, term2;
}
9. Draw the abstract syntax tree of the following assignment expression: x = y + 1
Statement
Assignment
Variable Statement
x Binary
Expressions Operator Expressions
Value op Value
term1 term2
10. By an example, show that the following BNF is ambiguous. Show at least 2 different parse trees
-> |
->
-> + | -
Example 1:
=>
=> +
=> +
=> + +
=> a + + < id>
=> a + b + c
Example 2:
=>
=> +
=> + < id>
=> + + c
=> + < id> + c
=> a + b + c
Two distinct parse trees for the same sentence, a + b + c. The BNF is ambiguous.
Different languages express negations in different ways. In this paper we will try to see how negation system of the Russian language can be interpreted within the boundaries of syntax.
During that late 1960's and early 1970's, BASIC was one of the premier programming languages. At that time, Bill Gates and his friend Paul Allen made the commitment to learn BASIC by reading the user manuals. In exchange for computer time, they made an agreement with a local company called the Computer Center Corporation to provide de-bugging services for software on the company's DEC machine. This time was used not only to search for errors, but also to study the operating systems from any discarded code they came across. Moreover, during this time Gates continued to expand his knowledge of computer programming as he taught himself other programming languages including FORTRAN, LISP and PDP-10 machine language. (Reitz, 1996)
The more equations the program has to do, so the program is a lot bigger and needs a lot more power to do everything the game wants.
Our teacher Grayde Bowen is currently teaching us C++. We are starting with C++ because it is a stepping stone to more complex programming languages. The reason for starting with a basic programming language such as C++ is because it is quite easy to learn and will help grasp the basic concept of a language. The main purpose of learning any language is so that you can grasp the fundamental elements which hold the key to more complex programming languages in today’s computing world.
(Wells, 2001) When compared to using PP, an advantage to using EDP that there is no need for a strict and chronological order of code for the flow of the program. (Wells, 2001) In EDP, the programming code entails an event-loop that idles until an event occurs to call on it. Next, the event then executes the appropriate event-handling routine until a protocol is met or a defined sentinel terminates it. (Wells, 2001) Two examples of EDP in today’s programming world are Visual Basic and Visual C++. (Wells, 2001) Both programming languages utilize an Integrated Development Environment (IDE) that delivers wide-ranging standard controls with each having its own “set of events and event-handler code templates.” (Wells, 2001, para 12) The IDE maintains of the flow of program execution by handling the scheduler and event queue. (Wells, 2001) As a result, the programmer is opened up to focus on the application specific code to allow it to react to a specific event, but does not need to know how to construct the actual objects. (Wells, 2001) EDP has fast-tracked as the result of the instituting of the Graphical User Interface (GUI) and has been commonly accepted for use in operating systems, as well as, client applications. (Wells,
Atomic sentences have truth-values that evaluate the application of a concept to an object that is being referred. To find what the sentence refers to, the referent of the predicate must be applied to the referent of the subject. Connectives are vocabulary like “and”, “if”, and “not” that are functions from truth-values to truth tables. Each of these provide the basis for Frege’s language system such that we are able to speaking in our ordinary language, but still maintain the mathematical connection he attempts to establish early. Frege’s use of language and sentences being functions with variables is consistent with how he defines the basic constructs of what are needed in a human language.
Also, CISC has more transistors required for storing complex instructions. It also requires less memory to store the instructions since it is stored in the many transistors in the complex instruction set computer. Whilst, on the other hand RISC has more memory required to store the instructions and lesser transistors are required.
If P1 and P2 are formulae, then so are P1 ⋁ P2, P1 ⋀ P2, and P1 ⇒ P2.
These must be handled in the code or the code will not compile cleanly, resu...
While there are some disadvantages to the Binary system, the ability for computers to process information with the Binary notation makes a valuable
The language itself borrows much syntax from C and C++ but has a much simpler object model and does away with low level tools like programmer-manipulable pointers.
As the scope domain of C and C++ covers real time and high-performance applications; both languages allow developers to define their own memory management control to improve memory efficiency and performance. Since C++11 version of C++ was introduced move semantics [Kalev, 2011] which is an additional approach to manage memory pointers with the aim of improving the reliability in the memory management control. On the other hand, JavaScript is a pure interpreted language which is very reliable in its implementation of memory management; JavaScript uses a Garbage Collector for memory
Pascal programming language was designed in 1968, and published in 1970. It is a small and efficient language intended to encourage good programming practices using structured programming and data structuring. Pascal was developed by Niklaus Wirth. The language was named in honor of the French mathematician and philosopher Blaise Pascal. In 1641, Pascal created the first arithmetical machine. Some say it was the first computer. Wirth improved the instrument eight years later. In 1650, Pascal left geometry and physics, and started his focus towards religious studies. A generation of students used Pascal as an introduction language in undergraduate courses. Types of Pascal have also frequently been used for everything from research projects to PC games. Niklaus Wirth reports that a first attempt to merge it in Fortran in 1969 was unsuccessful because of Fortran's lack of complex data structures. The second attempt was developed in the Pascal language itself and was operational by mid-1970. A generation of students used Pascal as an introductory language in undergraduate courses. Pascal, in its original form, is a Procedural language and includes the traditional like control structures with reserved words such as IF, THEN, ELSE, WHILE, FOR, and so on. However, Pascal has many data structuring and other ideas which were not included in the original, like type definitions, records, pointers, enumerations, and sets. The earliest computers were programmed in machine code. This type of programming is time consuming and error prone, as well as very difficult to change and understand. Programming is a time-consuming a process. More advanced languages were developed to resolve this problem. High level languages include a set of instruction...
Syntax is the study of how words are combined to create phrases and causes in the sentences of a specific language (Freeman and Freeman, 2014). Syntax helps us to make clear sentences that “sound right,” where words, phrases, and clauses each serve their function and are correctly ordered to form and communicate a complete sentence with meaning. The rules of syntax combine words into phrases and phrases into sentences. Not only does it focus on the correct word order for a language, but it also helps show the relationship between the meaning of a group of words. Without proper syntax, a sentence can be meaningless. It is key to understand that while every language does have certain syntax, the syntax does vary from language to language. It