Question

In: Computer Science

The home work is to do a survey comparing the following three programming language: COBOL ,...

The home work is to do a survey comparing the following three programming language:
COBOL , FOTRAN 77, and PASCAL regarding:

1-   Character set.
2-   Reserved(key) words and special symbols.
3-   Simple data types and data structures used.
4-   Control structures used (selection and loop structures)
5-   File structure used.

Solutions

Expert Solution

CHARACTER SET IN COBOL:

The most basic and indivisible unit of the COBOL language is the character. The basic character set includes the letters of the Latin alphabet, digits, and special characters. In the COBOL language, individual characters are joined to form character-strings and separators.

Basic COBOL character set.

Character Meaning Space + Plus sign - Minus sign or hyphen * Asterisk / Forward slash or solidus = Equal sign $ Currency sign1 , Comma ; Semicolon . Decimal point or period " Quotation mark2 ' Apostrophe ( Left parenthesis ) Right parenthesis > Greater than < Less than : Colon _ Underscore A - Z Alphabet (uppercase) a - z Alphabet (lowercase) 0 - 9 Numeric characters

CHARACTER SET IN FORTRAN 77:

The character set consists of the following:

  • Uppercase and lowercase letters, A - Z and a - z

  • Numerals 0 - 9

  • Special characters--The following table shows the special characters that are used for punctuation.

Space

Space

Tab

Tab

=

Equals

+

Plus

-

Minus

*

Asterisk

/

Slash

( )

Parentheses

,

Comma

.

Period

'

Apostrophe

"

Quote

$

Dollar sign

!

Exclamation

:

Colon

%

Percent

&

Ampersand

?

Question mark

\

Backslash

< >

Angle

CHARACTER SET IN PASCAL:

A set is a collection of elements of same type. Pascal allows defining the set data type. The elements in a set are called its members. In mathematics, sets are represented by enclosing the members within braces{}. However, in Pascal, set elements are enclosed within square brackets [], which are referred as set constructor.

COBOL RESERVED WORDS:

A

ACCEPT

ACCESS

ADD

ALPHABETIC-LOWER

ALPHABETIC-UPPER

ALPHANUMERIC

APPLY

ARE

AREA

B

BASIS

BEFORE

BEGINNING

BINARY

BLANK

BLOCK

BOTTOM

BY

C

CALL

CANCEL

CBL

COLUMN

COM-REG

COMMA

COMPUTATIONAL-5

COMPUTE

CONFIGURATION

D

DATA

DATE-COMPILED

DATE-WRITTEN

DEBUG-SUB-1

DEBUG-SUB-2

DEBUG-SUB-3

DESTINATION

DETAIL

DISPLAY

E

EGCS

EGI

EJECT

END-INVOKE

END-MULTIPLY

END-OF-PAGE

ENDING

ENTER

ENTRY

F

FALSE

FD

FILE

FILLER

FINAL

FIRST

FOR

FROM

FUNCTION

G

GENERATE

GIVING

GLOBAL

GO

GOBACK

GREATER

GROUP

H

HEADING

HIGH-VALUE

HIGH-VALUES

I

I-O

I-O-CONTROL

ID

INDICATE

INHERITS

INITIAL

INSPECT

INSTALLATION

INTO

J

JUST

JUSTIFIED

K

KANJI

KEY

L

LABEL

LAST

LEADING

LIMIT

LIMITS

LINAGE

LINES

LINKAGE

LOCAL-STORAGE

M

MEMORY

MERGE

MESSAGE

METHOD

METHOD-ID

MODE

MORE-LABELS

MOVE

MULTIPLE

N

NATIVE

NATIVE_BINARY

NEGATIVE

NO

NOT

NULL

NUMBER

NUMERIC

NUMERIC-EDITED

P

PACKED-DECIMAL

PADDING

PAGE

PIC

PICTURE

PLUS

PROCEDURE-POINTER

PROCEDURES

PROCEED

Q

QUEUE

QUOTE

QUOTES

R

RANDOM

RD

READ

RELATIVE

RELEASE

RELOAD

RESERVE

RESET

RETURN

S

SAME

SD

SEARCH

SIGN

SIZE

SKIP1

STANDARD

STANDARD-1

STANDARD-2

T

TABLE

TALLY

TALLYING

TEXT

THAN

THEN

TITLE

TO

TOP

U

UNIT

UNSTRING

UNTIL

UP

UPON

USAGE

USE

USING

V

VALUE

VALUES

VARYING

W

WHEN

WHEN-COMPILED

WITH

WORDS

WORKING-STORAGE

WRITE

WRITE-ONLY

Z

ZERO

ZEROES

ZEROS

FORTRAN RESERVED WORDS:

Unlike most other languages, Fortran does not have any reserved words. Although it is possible to use words that the language is built upon as variable names if the context shows that it can't be meant as a keyword, this can become very confusing and is therefore not recommended.

and array begin case const
div do downto else end
file for function goto if
in label mod nil not
of or packed procedure program
record repeat set then to
type until var while with

RESERVED WORDS IN PASCAL

DATA TYPES IN COBOL:

There are mainly five data types in COBOL.   

  • Numeric
  • Alphabet.
  • Alpha-numeric.
  • Sign.
  • Assumed decimal point.

DATA STRUCTURES IN COBOL:

A COBOL copybook is a selection of code that defines data structures. If a particular data structure is used in many programs, then instead of writing the same data structure again, we can use copybooks. We use the COPY statement to include a copybook in a program. COPY statement is used in the WorkingStorage Section

DATA TYPES IN FORTRAN 77:

Fortran 77 Data Type Size
BYTE X CHARACTER X CHARACTER* n X 1 1 n
COMPLEX X COMPLEX*8 X DOUBLE COMPLEX X COMPLEX*16 X COMPLEX*32 X 8 8 16 16 32
DOUBLE PRECISION X REAL X REAL*4 X REAL*8 X REAL*16 X 8 4 4 8 16
INTEGER X INTEGER*2 X INTEGER*4 X INTEGER*8 X 4 2 4 8

DATA STRUCTURES IN FORTRAN 77:

The STRUCTURE @ statement organizes data into structures.

STRUCTURE [/structure-name/] [field-list]

      field-declaration

     field-declaration

    . . .

END STRUCTURE

DATA TYPES IN PASCAL:

There are four simple scalar data types in Pascal: INTEGER, REAL, CHAR and BOOLEAN.

DATA STRUCTURES IN PASCAL:

An array is a data structured whose domain is a finite subset of Euclidean n-space Rn. Observation. Arrays in PASCAL are assigned the datatype of the elements that they contain, which can bee one and only one datatype.


Related Solutions

What is the primary goal in using a scripting language for programming work?
What is the primary goal in using a scripting language for programming work?
1. Language Survey About 42.3% of Californians speak a language other than English at home. Using...
1. Language Survey About 42.3% of Californians speak a language other than English at home. Using your class as the sample, conduct a hypothesis test to determine if the percent of students at De Anza Collegethat speak a language other than English at home is different from 42.3%. DATA TO USE: 16 out of 26 students in the sample speak a language other than English at home 1. Language Survey a.  Ho: _______________  b.  Ha: ___________________ c.  In words, CLEARLY state what your random...
Write a simple Calculator program using Scheme programming language. It should be able to do following...
Write a simple Calculator program using Scheme programming language. It should be able to do following operations: "+", "-", " * *, "/". the format when using the calculator function should be (calculator(operand1 operation operand2)) -> (calculator(2 + 5)) should give the output of 7.
LISP Programming Language Write a Bubble Sort program in the LISP Programming Language called “sort” that...
LISP Programming Language Write a Bubble Sort program in the LISP Programming Language called “sort” that sorts the array below in ascending order.  LISP is a recursive language so the program will use recursion to sort. Since there will be no loops, you will not need the variables i, j, and temp, but still use the variable name array for the array to be sorted.             Array to be sorted is 34, 56, 4, 10, 77, 51, 93, 30, 5, 52 The...
C Programming Language (Code With C Programming Language) Problem Title : Which Pawn? Jojo is playing...
C Programming Language (Code With C Programming Language) Problem Title : Which Pawn? Jojo is playing chess himself to practice his abilities. The chess that Jojo played was N × N. When Jojo was practicing, Jojo suddenly saw a position on his chessboard that was so interesting that Jojo tried to put the pieces of Rook, Bishop and Knight in that position. Every time he put a piece, Jojo counts how many other pieces on the chessboard can be captured...
In the java programming language. How would you find if THREE (3) numbers in an array...
In the java programming language. How would you find if THREE (3) numbers in an array add up to a certain sum so for example if my array element consists of: INPUT: 200, 10, 50, 20 and my output asks if these elements add to: 270? YES (200+50+70) 260? YES (200+10+50) 30? NO What method would you suggest to look through the elements in an array (which im going to add through a text file) and determine if these sums...
Exercises: Home Work to do : 1) write BNF grammars for the following sententials: lexemes (not...
Exercises: Home Work to do : 1) write BNF grammars for the following sententials: lexemes (not tokens) - positive and negative integer numbers - floating point numbers - variable names in C ------------------------------------ 2) check (recognize) if this code can derive from the given grammar ? - swith (tatal) { case total > 1000 : cout<<"expensive"; break; case total = 1000 : cout<<"exact"; break; case total < 1000 : cout<<"cheap"; break; }
Assembly Language Programming Construct an assembly language program fragment equivalent to the following C/C++ statement: if...
Assembly Language Programming Construct an assembly language program fragment equivalent to the following C/C++ statement: if (M <= N + 3 && (C == ‘N’ || C == ‘n’)) C = ‘0’; else C = ‘1’; Assume that M and N are 32-bit signed integer variables, and C is an 8-bit ASCII character variable. All variables are stored in memory, and all general-purpose registers are available for use.
In C programming language how do you find if all the character on a single line...
In C programming language how do you find if all the character on a single line in a 2 dimensional array are the same? The program should read line by line to check if all the characters on a line are the same. For this program we want to see if the * character ever shows up on a line where it is the only character on the line. as seen below. so lets say we have a array with...
HI, ANY PROGRAMMING LANGUAGE WOULD WORK, FROM PYTHON TO C++, MOST PREFERABLY OR ELSE ANY FOR...
HI, ANY PROGRAMMING LANGUAGE WOULD WORK, FROM PYTHON TO C++, MOST PREFERABLY OR ELSE ANY FOR YOUR CONVENIENCE. Let f(x) = x6 + 7x5− 15x4− 70x3 + 75x2 + 175x − 125. a.) Write a program that carries out the Secant Method on f(x). You do not need to make your program take arbitrary input (i.e. you can tailor it to this specific f(x)). Your program should take as input the appropriate number of initial guesses, an interval [a, b]...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT