Basics Flashcards
Ask user for a number, ask user for another number, multiply the two numbers, print result. What do you call this set of instructions? A. An algorithm B. A compiler C. A class D. PHP
A. An algorithm
An algorithm is a set of steps for carrying out a specific task. Algorithms are used extensively in computer programming to arrive at a solution for a problem. A real world example of an algorithm would be a recipe. The instructions of a typical recipe (add ingredients, mix, stir, etc.) are an algorithm.
If you needed to execute some code repeatedly based on a certain condition, which of the following would you use? A. Variable B. Loop C. Compiler D. Conditional
B. Loop
Loops are used to perform tasks repeatedly a certain amount of times. For example, if you needed to print the numbers 1 to 10. You can use a loop to do this instead of manually printing all the numbers.
You need special software to write programs.
True or False
False
It does help, but such software is not required, and for beginners it is better to work without it for the purpose of gaining experience. To write programs you just need a text editor.
Before source code can be compiled, it has to be \_\_\_\_\_\_\_\_\_\_\_\_\_\_\_. A. parsed B. viewed in a command prompt C. capitalized D. saved in a separate file
A. parsed
Which generation of languages allows for the use of words and commands? A. 2nd generation B. 1st generation C. 5th generation D. 3rd generation
D. 3rd generation
Before the 3rd generation of languages (3GL), it was just symbolic names (2nd generation), and before that just numbers (1st generation).
What is the software called that translates code into something meaningful the computer can understand? A. Converter B. Compiler C. Translator D. Transliterator
B. Compiler
Specifically, a compiler is used to turn source code into object code which is then passed through a program called a linker which turns it into an executable program.
What is computer programming?
A. Convincing the computer to never freeze
B. Setting the alarm on a computer
C. Speeding up your computer
D. Telling the computer what to do through a special set of instructions
D. Telling the computer what to do through a special set of instructions
True or False
Beginner programmers should start with a development environment
False
If beginners use development environments, they may never really learn whatever language they are trying to learn since a development environment makes writing code easier. Beginners should start from the bottom and work their way up, writing source code without any additional help from software (development environments). Once a beginner feels comfortable enough, they can move on to using a development environment.
What is object-oriented programming?
A. A type of programming involving a structured method of creating programs
B. A type of programming using only numbers
C. A type of programming involving data types representing data structures
D. A type of programming not in use anymore
C. A type of programming involving
What is the difference between a variable and a constant?
A. Variables can be declared only in software languages
B. Constants can be declared only in Java
C. No difference
D. The value of a constant doesn’t change, the value of a variable can change all throughout a program
D. The value of a constant doesn’t change, the value of a variable can change all throughout a program.
A variable and a constant serve the same purpose - storing information in a computer’s memory, but the value of a variable can and does change all throughout a program, while the value of a constant does not change
Which of the following is NOT a software language? A. HTML B. Visual Basic C. C++ D. C
A. HTML
HTML is a web language. C, C++, and Visual Basic are all software development languages.
Who invented the programming language Java?
Sun Microsystems
Name three programming languages.
Java
C
C++
Define Algorithm.
A set of steps for carrying out a specific task.
What is the process of creating an algorithm?
The process of creating an algorithm involves documenting all the necessary steps needed to arrive at the solution and how to perform each step.
Define Source Code.
The actual text used to write the instructions for a computer program. This text is then translated into something meaningful the computer can understand.
Define Compiler
A software tool that translates source code into data that the computer can understand. Specifically, a compiler is used to turn source code into object code. The object code is then passed through a program called a linker which turns it into an executable program.
Define Data Type
The classification of pieces of information in a program.
Define floating-point numbers
numbers with a decimal part
Define integers
whole numbers
Define variable
a container which represents a value in a program.
What three types of data can be used as variables?
numeric values,
single characters,
text strings
Define Constant
a container which represents a value in a program that does not change
Define Array
A special type of variable used in many programming and web languages including PHP, Javascript, and Java that contains a list of related values. For example, a colors array would contain a list of colors.
Define Loop
A segment of code that executes repeatedly based on a certain condition.
True or False
Loops are used to perform tasks repeatedly a certain amount of times.
True
Define Function
A set of code used to carry out specific tasks.
Define Class
A template for a real world object to be used in a program.
HTML
Hyper Text Markup Language
XML
Extensible Markup Language
javascript
A language developed by Netscape used to provide dynamic and interactive content on webpages.
VBScript
Visual Basic Scripting Edition
PHP
Hypertext Preprocessor
Java
A powerful and flexible language created by Sun Microsystems that can be used to create applets that run inside webpages as well as software applications.
Applets
A program that is executed from within another program.
What is the considered the core language of the world wide web?
HTML
True or False
HTML is not static, but rather flexible
False.
HTML is static - content created with HTML does not change.
How does XML differ from HTML?
Like HTML, XML is used to define the structure and layout of web pages, but unlike HTML it allows for custom tags that are defined by programmers.
Does JavaScript communicate with HTML?
Yes, it is possible to communicate with HTML using JavaScript.
What web browser only uses VBScript?
VBScript was developed by Microsoft and will only work on Microsoft’s Internet Explorer web browsers and web browsers based on the Internet Explorer engine.
Name four software languages.
C,
C++,
Visual Basic,
Java
What software language was developed by Microsoft and is used for creating Windows applications?
Visual Basic
What software language is the descendent of a previous language and is object-oriented?
C++
What software language was originally developed in the 1970s at Bell Labs?
C
What software language is the UNIX operating system written in?
C
What software language is very popular for graphical applications?
C++
Currently, how many generations exist of computer programming languages?
5
Name the five current generations of computer programming languages.
first generation languages (1GL), second generation languages (2GL), third generation languages (3GL), fourth generation languages (4GL), fifth generation languages (5GL)
Describe first generation computer programming language.
very early, primitive,
consists entirely of 1’s and 0’s,
machine language
Describe second generation computer programming language.
allows for use of symbolic names instead of just numbers,
known as assembly languages,
code written in an assembly language is converted into machine language (1GL)
Describe third generation computer programming language.
introduction of words and commands,
have syntax that is easier to understand,
known as ‘higher level languages’
includes C, C++, Java, and Javascript
Describe fourth generation computer programming language.
syntax used is close to human language,
typically used to access databases,
includes SQL and ColdFusion
Describe fifth generation computer programming language.
currently used for neural networks
What is a neural network?
A form of artificial intelligence that attempts to imitate how the human mind works.
Name three procedure-oriented languages?
COBOL,
FORTRAN,
C
What is procedure-oriented programming?
A type of programming where a structured method of creating programs is used.
What is object oriented programming?
A type of programming where data types representing data structures are defined by the programmer as well as their properties and the things that can be done with them.
In object-oriented programming, what do you call data types defined by the programmer?
classes (templates for a real world object to be used in a program)
What does it mean to ‘parse’ code?
To break up the code into smaller parts. Source code must be parsed before it can be converted into meaningful data for the computer.
What step follows parsing source code?
Compilation
What is meant by compiling source code?
Turning the code into an actual program.
Name the two steps involved in compiling source code.
- source code is turned into object code by a compiler. 2. object code must be passed through a linker.
What does it mean to Interpret Source Code?
It means to turn the code into an intermediate form which is executed by a program called an interpreter instead of turning source code directly into machine code like a compiler does.
What type of code does a compiler turn source code into?
machine code
What happens to code written in languages for software development? (e.g. C, C++, C#, and Delphi)
This type of code is compiled because these languages are designed to create executable programs.
What happens to code written in languages used for web development? (e.g. JavaScript, VBScript, PERL, and PHP)
This type of code is interpreted because these languages are designed to create web applications and display data on web pages, not to create an executable program.
Name four examples of languages used for web development.
- JavaScript
- VBScript
- PERL
- PHP
Name four examples of languages for software development.
- C
- C++
- C#
- Delphi
What two tools are needed to write a program?
A text editor and a software tool to turn your source code into meaningful data that the computer can understand (compiler and/or interpreter).
How would one access a text editor in windows?
Use notepad.
Go to Start -> Programs -> Accessories -> Notepad or Start -> Run -> Type ‘notepad’ and press Enter.