Programming Language Assignment

Alhznawi
CSC-Assignment1.docx

Question 1: What is the domain of the programming language?

· Scientific Applications.

· Business Applications.

· Artificial Intelligence.

· Systems Programming.

· Scripting Languages.

· Special Purpose Languages.

· General Purpose Languages.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 2: Evaluate the programming language in the terms of the following:

· Readability

· Overall simplicity.

· Orthogonality.

· Control statements.

· Data types and structures.

· Syntax considerations.

· Writability

· Simplicity and Orthogonality.

· Support of Abstraction.

· Expressivity.

· Reliability

· Type checking.

· Exception handling.

· Aliasing.

· Cost

· Cost of training programmers.

· Cost of writing programs.

· Cost of compiling programs.

· Cost of executing programs.

· Cost of the language implementation system.

· Cost of poor reliability.

· Cost of maintaining programs.

· Portability

· Generality

· Well-definedness

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 3: Categorize the programming language in to the following categories:

· Imperative Programming Languages.

· Functional Programming Languages.

· Logic Programming Languages.

· Object-Oriented Programming Languages.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 4: Explain what binding technique the programming language uses:

· Static Binding.

· Dynamic Binding.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 5: Discuss the following language design Trade-Offs according to the programming language:

· Reliability vs. Cost of execution

· Readability vs. Writability

· Writability vs. Reliability

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 6: Discuss the implementation method of the programming language:

· Compiler implementation

· Pure interpretation

· Hybrid implementation

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 7: Give 5 examples of (Preprocessors) that the programing language does have, and explain its job.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 8: What are all the programming environments used to develop applications in the programming language? Give more details in 3 lines for each.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 9: Explain what derivation type that the programming language uses:

· Leftmost derivation

· Rightmost derivation

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 10: Write a BNF grammar and draw a syntax graph that demonstrate the following:

· Associativity of + Operator

· Associativity of * Operator

· Associativity of / Operator

· Associativity of ^ Operator

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 11: Discuss Naming in the programming language in the terms of the following:

· What is the maximum length?

· Are connector characters permitted?

· Is it a case sensitive?

· Can Reserved words be used as a user-defined name?

· Can Keywords be used as a user-defined name?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 12: Write a statement that declares X as an integer constant with a value 8.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 13: Discuss Variables in the programming language in the terms of the following and Give example for each:

· How do you give a name to variable? What are the rules of naming the variables?

· Can you access the address of a variable in a program? If so, what an operator you use?

· Can a variable have different addresses at different times?

· Can a variable have different addresses at different places in a program?

· Does the language allow aliases?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 13: Discuss Variables in the programming language in the terms of the following and Give example for each:

· How do you give a name to variable? What are the rules of naming the variables?

· Can you access the address of a variable in a program? If so, what an operator you use?

· Can a variable have different addresses at different times?

· Can a variable have different addresses at different places in a program?

· Does the language allow aliases?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 14: Determine at what time the binding between variable and its type or value happens.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 15: Determine at what time the binding between an operation and an operator symbol happens.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 16: Determine whether the programming language uses static or dynamic binding between the variable and its data type. And if static, Does it use explicit declaration or implicit declaration.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 17: Is the programming language a strong typed? And what does it mean saying a programming language is a strong typed?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 18: Is the scope of a variable in the programming language static or dynamic. And what are its the advantages and disadvantages?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 19: What are the primitive data types that the programming language has in each of the following major categories?

· Numeric.

· Boolean.

· Character.

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 20: List all the operations can be done on strings data type and a description for each?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 21: Which of the following character string length options does the programming language use?

· Static Length

· Limited Dynamic Length

· Dynamic (no maximum)

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 24: What are the Associative Arrays, and does the programming language support it?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Question 25: Does the programming language have Record type? If so, answer the followings:

· What is the syntax of defining a Record?

· Redefine the below COBOL record using the syntax of the programming language.

01 EMP-REC.

02 EMP-NAME.

05 FIRST PIC X(20).

05 MID PIC X(10).

05 LAST PIC X(20).

02 HOURLY-RATE PIC 99V99.

· What is the syntax of reference an element in a record? And reference the element “FIRST”?

· Does the programming language allow elliptical references of a record’s elements?

Programming Language #1 (Eiffel)

Programming Language #2 (Pythons)

Programming Language #3 (Lisp)

Programming Language #4 (COBOL)

Programming Language #5 (C)

Programming Language #6 (Ruby)

Assignment -1- - 14 -