0% found this document useful (0 votes)
33 views5 pages

CSC 422 Assignment (Individual)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
33 views5 pages

CSC 422 Assignment (Individual)

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 5

1.

GENEALOGY OF PROGRAMMING LANUAGES

FORTRAN

Formula Translation, or FORTRAN, is a computer programming language developed by John


Backus in 1957 that simplified and broadened computer programming. The evolution of
computer programming languages advanced significantly with the invention of FORTRAN,
which made its debut in 1957. Released in 1978, FORTRAN 77 was later followed by
FORTRAN 90 in 1991 and updates in 1996, 2004, 2010, and 2018. Outside of academic settings,
fourth and fifth generation languages starting in the 1970s mainly replaced FORTRAN.

PASCAL

Pascal, a computer programming language developed about 1970 by Niklaus Wirth of


Switzerland to teach structured programming, which emphasizes the orderly use of conditional
and loop control structures without GOTO statements. Although Pascal resembled ALGOL in
notation, it provided the ability to define data types with which to organize complex information,
a feature beyond the capabilities of ALGOL as well as FORTRAN and COBOL.

PYTHON

Designed by Guido Van Rossum in 1991, Python is easier to read and requires fewer lines of
code than many other computer programming languages. It was named after the British comedy
group Monty Python. Popular sites like Instagram use frameworks that are written in Python.

C++

Bjarne Stroustrup modified the C language at the Bell Labs, C++ is an extension of C with
enhancements such as classes, virtual functions, and templates. It has been listed in the top 10
programming languages since 1986 and received Hall of Fame status in 2003. C++ is used in MS
Office, Adobe Photoshop, game engines, and other high-performance software.

BASIC

BASIC was an acronym for Beginner's All-Purpose Symbolic Instruction Code written at
Dartmouth college in 1963. It was developed by Dartmouth mathematicians John George
Kemeny and Tom Kurtzas as a teaching tool for undergraduates. BASIC was intended to be a
computer language for generalists to use to unlock the power of the computer in business and
other realms of academia.

2.
i. DIFFERENCE BETWEEN ERROR AND EXCEPTION

Exceptions can be foreseen by the programmer, while an error is difficult to foresee.


Exceptions can be checked or unchecked. But errors are always unchecked. Exceptions
typically indicate an error caused by the programmer. However, errors occur due to a system
error or an inappropriate usage of a resource.

ii. PRIMITIVE AND USER DEFINED DATA TYPES IN:

JAVA

1) Primitive -> byte, char, short, int, long, float, double and boolean.

2) Non-primitive -> (All Classes) -> String, Arrays etc.

Type Size Stores

byte 1 byte whole numbers from -128 to 127

short 2 bytes "" -32,768 to 32,767

int 4 bytes "" -2,147,483,648 to 2,147,483,647

long 8 bytes ""-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807

float 4 bytes fractional numbers; for storing 6 to 7 decimal digits

double 8 bytes fractional numbers; "" 15 ""

Boolean 1 bit true or false values

char 2 bytes single character/letter or ASCII values


C++

Primitive Data Types:

Integer: The keyword used for integer data types is int. Integers typically require 4 bytes of
memory space and range from -2147483648 to 2147483647.

Character: Character data type is used for storing characters. The keyword used for the
character data type is char. Characters typically require 1 byte of memory space and range
from -128 to 127 or 0 to 255.

Boolean: Boolean data type is used for storing Boolean or logical values. A Boolean variable
can store either true or false. The keyword used for the Boolean data type is bool.

Floating Point: Floating Point data type is used for storing single-precision floating-point
values or decimal values. The keyword used for the floating-point data type is float. Float
variables typically require 4 bytes of memory space.

Double Floating Point: Double Floating Point data type is used for storing double-precision
floating-point values or decimal values. The keyword used for the double floating-point data
type is double. Double variables typically require 8 bytes of memory space.

void: Void means without any value. void data type represents a valueless entity. A void data
type is used for those function which does not return a value.

Wide Character: Wide character data type is also a character data type but this data type has a
size greater than the normal 8-bit datatype. Represented by wchar_t. It is generally 2 or 4
bytes long.

Abstract or User-Defined Data Types:

Class, Structure, Union, Enumeration, Typedef defined Datatype


PYTHON

Primitive data types:

Integer

String

Boolean

Float

Non-primitive data types:

Lists, Array, Files, Tuple, Sets

3.
1. Identify 3 programming language & their naming nomenclature

JAVA

In Java, naming conventions for identifiers have been established and suggested by various
Java communities such as Sun Microsystems, Netscape, AmbySoft etc. A sample of naming
conventions set by Sun Microsystems are listed below, where a name in "CamelCase" is one
composed of a number of words joined without spaces, with each word's -- excluding the
first word's -- initial letter in capitals – for example "camelCase".

PYTHON

Python recommend UpperCamelCase for class names,


CAPITALIZED_WITH_UNDERSCORES for constants, and snake_case for other names.

JAVASCRIPT

The built-in JavaScript libraries use the same naming conventions as Java. Data types and
constructor functions use upper camel case (RegExp, TypeError, XMLHttpRequest,
DOMObject) and methods use lower camel case (getElementById,
getElementsByTagNameNS, createCDATASection). In order to be consistent most
JavaScript developers follow these conventions

2. Which do you prefer and why?

Preference: JavaScript

Reason: javascript naming nomenclature is beginners friendly and It is flexible.

4. Programming languages and how their variables are specified

C++

type variableName = value;

Where type is one of C++ types (such as int), and variableName is the name of the variable (such
as x or myName). The equal sign is used to assign values to the variable.

Java

type variableName = value;

Where type is one of Java's types (such as int or String), and variableName is the name of the
variable (such as x or name). The equal sign is used to assign values to the variable.

C#

type variableName = value;

Where type is a C# type (such as int or string), and variableName is the name of the variable
(such as x or name). The equal sign is used to assign values to the variable.

You might also like