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.