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.
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.
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.
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)
(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,
Visual Basic is a specific programming language that is used to make the code using variables and assigning those variables values as I mentioned earlier. In this language the structure are set up kind of like a book. “Programs written in Visual Basic also have a structure: modules are like chapters, procedures are like paragraphs, and lines of code are like sentences.” (msdn.microsoft.com/en-us/library/ms172579(v=vs.90).aspx) That means that you break it down like the language you read in a book as mentioned previously. A very similar structure between the two which makes for an easy to understand
Java vs. C++ papers = Since their inception, computers have played an increasingly important role in today’s society. Advancements in technology have enabled computers to become faster and cheaper. Today, the majority of families own a home computer that is vastly more powerful than giant mainframes of years gone by. Computer hardware has been evolving rapidly with no end in sight, and with all of the advancements in computer hardware come advancements in computer software; gone are the days when FORTRAN and COBOL were the languages of choice. Today, vvv two hot new object oriented programming languages have entered the computer programming arena, Java and C++, this paper will examine the similarities and differences between these new languages. Both Java and C++ are object oriented programming languages, but what does that mean? Object oriented programming (OOP) emphasizes data, instead of algorithms for solving problems. Instead of trying to fit a problem to the procedural approach of a language, OOP attempts to fit the language to the problem, in other words, OOP is structured to produce an answer without changing the question. Object oriented programming involves two separate parts, class and objects. Class is a specification that describes a new data form, it is a template that defines how an object will look and behave.(Kaj 1996, 8) An object is that particular data structure constructed using the parameters defined by class.(Prata 1995, 5) The object oriented programming approach to program design is to first design classes that accurately represent those things with which the program deals. A drawing program, for example, might define classes to represent rectangles, lines, circles, brushes, pens, and the like. The class definitions, recall, include a descriptions of permissible options for each class, such as moving a circle or rotating a line.(Prata 1995, 5) The main advantages of OOP, besides being able to create more complex software, and develop answers without changing the questions, are numerous. OOP facilitates creating reusable code, which can save a lot of work. Information can be hidden to safeguard data from improper access. Polymorphism lets the programmer create multiple definitions for operators and functions, with the programming context determining which definition is used, also Inheritance lets the programmer derive new classes from older ones.
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.
CISC were designed with the thought that programing language programming was of the utmost importance. High-level languages weren't very hip once CISC 1st came out. They wished to create it easier for the user to program in assembly. once scientists analyzed instruction streams they complete that greatest quantity of your time was spent death penalty easy directions and doing hundreds and stores. The compiler terribly seldom used the advanced directions that CISC used. The compil...
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...
The principal advantage of the Binary system is its simplicity. Computers are able to use the one and the zero more easily than they are able to use decimal numbers, therefore making both programming and carrying out tasks much less complicated.
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
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