You are on page 1of 7

Assignment #1 November 12, 2012 Maria Angelica D. Arevalo 1. What is programming language?

Programming Language is a set of symbols and rules governing their use that are used in constructing programs. It is a computer language programmers use to develop applications, scripts, or other set of instructions for a computer to execute. 2. What are the types of programming language? There are three (3) fundamental types of Programming Languages. These are: a. Machine Language: A program consists of a sequence of bits that are all zeros and ones. Each combination of zeros and ones is an instruction to the computer about something. It is the only language a computer can understand directly. For example, the number 455 is represented by the bit sequence 111000111. Machine language is a low-level programming language. It is easily understood by computers but difficult to read by people. This is why people use higher level programming languages. Programs written in high-level languages are compiled and/or interpreted into machine language so computers can execute them. b. Assembly Language: A symbolic representation of machine language. There is usually a one-to-one correspondence between two; each assembly language instruction translates into one machine language instruction. However, language uses easily recognizable codes, which make it a lot easier for the people to understand. Before a computer can carry out an assembly language program, the computer must translate it into machine language. This is done by a special program called an assembler. For example, assembly language statements like MOV and ADD are more recognizable than sequences of 0s and 1s. Though assembly language statements are readable, the statements are still low-level. Another disadvantage of assembly language is that it is not portable. In other words, assembly language programs are specific to a particular hardware. Assembly language programs for a Mac will not work on a PC. But this can be an advantage for programmers who are targeting a specific platform and need full control over the hardware. c. High-Level Language: Usually contain English words and phrases. Their symbols and structure are far removed from those of machine language. Languages such as C, C++ and Java are all high-level languages. High-Level languages have several advantages over machine or assembly languages; they are easier to learn and use, and the resulting programs are easier to read and modify. The statements in these languages are English-like. For example, you can gain a basic understanding of what a Java program is doing by simply reading the program source code. High1|Page MADA

level languages use English words as statements. Loops in Java programs are indicated by the words for, while and do. To get the current system time (ms) in Java you would call System.currentTimeMillis(). Another advantage of high-level languages is that they are less tedious to use. A single statement in a high-level language can translate into many machine language statements. Finally, highlevel languages are usually portable. A disadvantage of high-level languages is that they are usually less powerful and less efficient. Since statements are highlevel, you cannot code at the bit level the way you can with assembly language. High-level languages also need to be compiled and/or interpreted into machine language before execution. 3. Differentiate: computer, program and programmer. Computer is a device that computes, especially a programmable electronic machine that performs high-speed mathematical or logical operations or that assembles, stores, correlates, or otherwise processes information. Program is an organized system of instructions and data interpreted by a computer. Programming instructions are often referred to as code. Programmer is a person who writes a program so that data may be processed by a computer. In short, the computer processes the programs that the programmer have installed and made. 4. Explain computer system. A computer system is a system of interconnected computers that share a central storage system and various peripheral devices such as a printers, scanners, or routers. Each computer connected to the system can operate independently, but has the ability to communicate with other external devices and computers. It usually refers to a computer and all of its input, output and storage devices that are connected to it. It will include the computer along with any software and peripheral devices that are necessary to make the computer function. Every computer system requires an operating system. The simple structure of computer system is: Input Unit (Keyboard) --- Processing Unit (Processor) --- Output Unit (Monitor) | Memory Unit (RAM, ROM) It is called a computer system because here many different parts combine to achieve a common goal, which is to give the output. 5. What are the common elements in programming language? According to Abelson and Sussman, in The Structure and Interpretation of Computer Programs, a good programming language must have the following four elements. Some examples of each one are given. Primitives (built-in things) Primitive Data (like numbers) Primitive Procedures (like addition)
2|Page MADA

Means of Combination Expressions (putting together values) Composition (putting together objects or procedures) Containment (putting objects inside of other objects) Means of Abstraction Naming Procedural Abstraction Data Abstraction Means of Capturing Common Patterns Creation of Types of Objects Inheritance (creating object types similar to others) Design patterns and frameworks (ways of putting objects together) On the other hand, these are programming domains elements that are used to define the syntax and to give examples of programming languages: apiname The <apiname> element provides the name of an application programming interface (API) such as a Java class name or method name. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. codeblock The <codeblock> element represents lines of program code. Like the <pre> element, content of this element has preserved line endings and is output in a monospaced font. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. codeph The code phrase (<codeph>) element represents a snippet of code within the main flow of text. The code phrase is displayed in a monospaced font for emphasis. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. option The <option> element describes an option that can be used to modify a command (or something else, like a configuration). This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. parmname When referencing the name of an application programming interface parameter within the text flow of your topic, use the parameter name (<parmname>) element to markup the parameter. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information.
3|Page MADA

parml The parameter list (<parml>) element contains a list of terms and definitions that describes the parameters in an application programming interface. This is a special kind of definition list that is designed for documenting programming parameters. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. plentry The parameter list entry element (<plentry>) contains one or more parameter terms and definitions (pd and pt). This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. pt A parameter term, within a parameter list entry, is enclosed by the <pt> element. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. pd A parameter definition, within a parameter list entry, is enclosed by the <pd> element. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. synph The syntax phrase (<synph>) element is a container for syntax definition elements. It is used when a complete syntax diagram is not needed, but some of the syntax elements, such as kwd, oper, delim, are used within the text flow of the topic content. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. syntaxdiagram The syntax diagram (<syntaxdiagram>) element is the main container for all the syntax elements that make up a syntax definition. The syntax diagram represents the syntax of a statement from a computer language, or a command, function call or programming language statement. Traditionally, the syntax diagram is formatted with railroad tracks that connect the units of the syntax together, but this presentation may differ depending on the output media. The syntax diagram element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. groupseq The <groupseq> element is part of the subset of elements that define syntax diagrams in DITA. A group is a logical set of pieces of syntax that go together. Within the syntax definition, groups of keywords, delimiters and other syntax units act as a combined unit, and they occur in a specific sequence, as delimited by the <groupseq> element. This

4|Page MADA

element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. groupchoice The <groupchoice> element is part of the subset of elements that define syntax diagrams in DITA. A group is a logical set of pieces of syntax that go together. A group choice specifies that the user must make a choice about which part of the syntax to use. Groups are often nested. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. groupcomp The <groupcomp> element is part of the subset of elements that define syntax diagrams in DITA. A group is a logical set of pieces of syntax that go together. The group composite means that the items that make up the syntax diagram will be formatted close together rather than being separated by a horizontal or vertical line, which is the usual formatting method. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. fragment Within a syntax definition, a <fragment> is a labeled subpart of the syntax. The <fragment> element allows breaking out logical chunks of a large syntax diagram into named fragments. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. fragref The fragment reference (<fragref>) element provides a logical reference to a syntax definition fragment so that you can reference a syntax fragment multiple times, or pull a large section of syntax out of line for easier reading. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. synblk The syntax block (<synblk>) element organizes small pieces of a syntax definition into a larger piece. The syntax block element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. synnote The syntax note (<synnote>) element contains a note (similar to a footnote) within a syntax definition group or fragment. The syntax note explains aspects of the syntax that cannot be expressed in the markup itself. The note will appear at the bottom of the syntax diagram instead of at the bottom of the page. The syntax block element is part of the

5|Page MADA

DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. synnoteref The syntax note (<synnoteref>) reference element references a syntax note element (<synnote>) that has already been defined elsewhere in the syntax diagram. The same notation can be used in more than one syntax definition. The syntax note reference element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. kwd The <kwd> element defines a keyword within a syntax diagram. A keyword must be typed or output, either by the user or application, exactly as specified in the syntax definition. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. var Within a syntax diagram, the <var> element defines a variable for which the user must supply content, such as their user name or password. It is represented in output in an italic font. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. oper The operator (<oper>) element defines an operator within a syntax definition. Typical operators are equals (=), plus (+) or multiply (*). This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. delim Within a syntax diagram, the delimiter (<delim>) element defines a character marking the beginning or end of a section or part of the complete syntax. Typical delimiter characters are the parenthesis, comma, tab, vertical bar or other special characters. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. sep The separator (<sep>) element defines a separator character that is inline with the content of a syntax diagram. The separator occurs between keywords, operators or groups in a syntax definition. This element is part of the DITA programming domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. repsep The repeat separator (<repsep>) element in a syntax diagram defines a group of syntax elements that can (or should) be repeated. If the <repsep> element contains a separator character, such as a plus (+), this indicates that the character must be used between repetitions of the syntax elements. This element is part of the DITA programming
6|Page MADA

domain, a special set of DITA elements designed to document programming tasks, concepts and reference information. References: Venit, S. & Drake, E. (2009). Prelude to programming: concepts & design (4th ed.). Addison-Weasley. New York City. Computer. Retrieved from http://www.thefreedictionary.com/computer on November 9, 2012. Computer system. Retrieved from http://www.businessdictionary.com/definition/computer-system.html on November 10, 2012. CSE131: introduction. Retrieved from http://www.arl.wustl.edu/~jst/cse/131/Notes/Intro/intro.html on November 10, 2012. Machine, assembly and high-level. Retrieved from http://voices.yahoo.com/programming-concepts-three-basic-types- programming8985937.html on November 10, 2012. Program. Retrieved from http://www.thefreedictionary.com/program on November 9, 2012. Programmer. Retrieved from http://www.thefreedictionary.com/programmer on November 9, 2012. Programming elements. Retrieved from http://docs.oasisopen.org/dita/v1.1/OS/langspec/common/pr-d.html on November 10, 2012. Programming language. Retrieved from http://www.computerhope.com/jargon/p/proglang.htm on November 9, 2012. What is a computer system?. Retrieved from http://sawaal.ibibo.com/computersandtechnology/what-computer-system-explain-structure-computer817253.html on November 10, 2012.

7|Page MADA

You might also like