Chapter 13 Programming and Data Representation Flashcards
What is python?
Python is a multi-paradigm programming language
Key characteristics of python.
Keywords are written in lower case
Python is case sensitive meaning Number1 <> NUMBER1
What is VB.NET?
VB.NET is a multi paradigm, high-level programming language, implemented on the .NET Framework.
Key characteristics of VB.NET.
Every statement should be on a separate line. However, if necessary statements can be typed on the same line with a colon as a separator
Indentation is a good practice
Not case sensitive
Programs need to be compiled
What is Pascal?
Pascal is a multi-paradigm programming language
Key characteristics of Pascal.
Every statement must end in a semicolon (;)
Indentation is a good practice
Not case sensitive
Programs need to be compiled
Compound statements consists of a sequence of statements enclosed between the keywords begin and end
How to declare variables in python, VB.NET and Pascal?
- Python does not have variable declaration
- VB.NET Dim [, identifier] As
- Pascal var [, identifier] : ;
How to declare and assign values to constants in python, VB.NET and Pascal?
- Python =
- VB.NET Const =
- Pascal Const = ;
What is the difference between a variable and a constant?
A constants value should not be changed and a variables name can be changed if so desired.
How to assign values to a variable in python, VB.NET and Pascal?
- Python =
- VB.NET =
- Pascal := ;
Which are the arithmetic operators are different in pseudocode, python, VB.NET and Pascal?
Exponent: - Python: ^ - Integer division: ** - CB.NET: ^ - Pseudocode: Not available Integer division: - Python: DIV - Integer division: // - CB.NET\ - Pseudocode: Div Modulus: - Python: MOD - Integer division: % - CB.NET: Mod - Pseudocode: Mod
What do the rules of precedence define?
The Rules of precedence define the order of the calculations to be performed
How to output information on the screen in python, VB.NET and Pascal?
- Python print() (Moves to next list)
print(, end = ‘ ‘) (To avioid moving onto the next line after the output) - VB.NET Console.WriteLine()
Console.Write() (To avoid moving to the next line) - Pascal WriteLn()
Write() (To avoid moving to the next line)
How to get an input from the user in python, VB.NET and Pascal?
- Python A = input(‘Prompt: ‘)
- VB.NET Console.Write(‘Prompt: ‘)
A = Console.ReadLine () - Pascal Write(‘Prompt: ‘)
How to add comments in python, VB.NET and Pascal?
- Python # this is a comment
- VB.NET // this is a comment
- Pascal // this is a comment
// this is another comment
{this is a multi-line comment if more comments have to be written}
How are whole signed numbers assigned in python, VB.NET and Pascal?
- Python int
- VB.NET Integer
- Pascal Integer
How are signed numbers with a decimal point assigned in python, VB.NET and Pascal?
- Python Not available
- VB.NET Char
- Pascal Char
How are strings assigned in python, VB.NET and Pascal?
- Python str
- VB.NET String
- Pascal String
How to write booleans in python, VB.NET and Pascal?
- Python bool
- VB.NET Boolean
- Pascal Boolean
How are Monetary values assigned in python, VB.NET and Pascal?
- Python Not available
- VB.NET Decimal
- Pascal Currency
How are date values assigned in python, VB.NET and Pascal?
- Python Not available as a built-in data type
- VB.NET Date
- Pascal TDateTime
How to write equal in python, VB.NET and Pascal?
- Python ==
- VB.NET =
- Pascal =