Quiz 1

0.0(0)
studied byStudied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/148

flashcard set

Earn XP

Description and Tags

Computer Programming 1

Last updated 8:47 PM on 2/22/23
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

149 Terms

1
New cards
Computer / Program
It is a sequence of statements whose objectives is to accomplish a task.
2
New cards
Programming
It is a process of planning and creating a program.
3
New cards
Data Type
It specifies the size and type of information the variable will store:
4
New cards
Variables
These are containers for storing data values.
5
New cards
int
stores integers (whole numbers), without decimals, such as 123 or -123
6
New cards
float
stores floating point numbers, with decimals, such as 19.99 or -19.99
7
New cards
double
stores floiting point numbers, with decimals, such as 19.99999 or -19.9999
8
New cards
char
stores single characters, such as 'a' or 'B'.
9
New cards
string
stores text, such as "Hello World".
10
New cards
double
String values are surrounded by _____ quotes
11
New cards
single
Char values are surrounded by ______ quotes
12
New cards
bool/ Boolean
stores values with two states: true or false
13
New cards
variabale or the name of the variable
*type* *variable* = *value*;

\
The unique identifier there is?
14
New cards
FALSE

\
Correct: Variable names can contain letters, digits and underscores.
Variable names cannot contain letters, digits and underscores.
15
New cards
FALSE

\
Correct:

Variable names must begin with a letter or an underscore (_).
Variable names must begin with a letter or an underscore (_) or special characters.
16
New cards
FALSE

\
Correct: Names are case sensitive ( **myVar** and **myvar** are different variables).
Names are not case sensitive ( **myVar** and **myvar** are same variables).
17
New cards
TRUE
Reserved words (like C++ keywords, such as **int** ) cannot be used as names.
18
New cards
FALSE
Variable Name: TRUE OR FALSE

\
int float = 4;
19
New cards
FALSE

\
Correct: *type* *variable* = *value*;
Syntax of declaring variable: TRUE OR FALSE

\
*type* *value* = *variable*;
20
New cards
const
This keyword will declare the variable as "constant", which means **unchangeable and read-only**
21
New cards
**** library
To use **strings,** you must include an additional header in the source code, the **_____**:
22
New cards
string
The ____ type is used to store a sequence of characters (text). 
23
New cards
Operators
____ are used to perform operations on variables and values.
24
New cards
Assignment
____ operators are used to assign values to variables.
25
New cards
Arithmetic
___ operators are used to perform common mathematical operations.
26
New cards
Bjarne Stroustoop
a Danish computer scientist at Bell Labs in the United States
27
New cards
December 30, 1950

\
When was the birth of Bjarne Stroustoop?
28
New cards
In 1975 at Aarhus University

\
When did Bjarne Stroustoop received his master’s degree in mathematics and where?
29
New cards
In 1979 at Cambridge University

\
When did Bjarne Stroustoop received his Ph.D in Computer Science and where?
30
New cards
C++
_________ is based on C and it retains much of that language, including a rich operator set.
31
New cards
TRUE
Every C++ program has a function called main.

TRUE OR FALSE
32
New cards
a.) object-oriented language
C++

a.) object-oriented language

b.) procedural language
33
New cards
Portability
____ refers to using the same piece of code in varied environments.
34
New cards
b.) middle
**C++** is regarded as a **___**-**level language**,

a.) low

b.) middle

c.) high
35
New cards
b.) compiler based
C++ is ____ language?

a.) interpreter-based

b.) compiler based
36
New cards
**OOP (Object-Oriented Programming):**
*C++ is an object-oriented language*, unlike C which is a procedural language. This is one of the most important features of C++. It employs the use of objects while programming.
37
New cards
**Platform or Machine Independent/ Portable**:
In simple terms, portability refers to using the same piece of code in varied environments. **C++** is ultra **portable** and has compilers available on more platforms than you can shake a stick at. Languages like Java are typically touted as being massively cross platform, ironically they are in fact usually implemented in C++, or C.
38
New cards
**Simple:**
When we start off with a new language, we expect to understand in depth. The simple context of __C++ Links to an external site.__ gives an appeal to programmers, who are eager to learn a new programming language.
39
New cards
**Mid-level programming language:**
**C++** is regarded as a **middle**-**level language**, as it comprises a combination of both high-**level** and low-**level language** features. It is a superset of C, and that virtually any legal C **program** is a legal **C++ program**. 
40
New cards
**Case sensitive:**
Just like C, it is pretty clear that the C++ programming language treats the uppercase and lowercase characters in a different manner.
41
New cards
**Compiler-Based:**
Unlike Java and Python that are interpreter-based, C++ is a compiler based language and hence it a relatively much faster than Python and Java.
42
New cards
**DMA (Dynamic Memory Allocation):**
Since C++ supports the use of pointers, it allows us to allocate memory dynamically. We may even use constructors and destructors while working with classes and objects in C++.
43
New cards
**Rich Library**
The C++ programming language offers a library full of in-built functions that make things easy for the programmer. These functions can be accessed by including suitable header files.
44
New cards
**Fast:** 
C++ is compiler-based hence it is much faster than other programming languages like Python and Java that are interpreter-based.
45
New cards
**Recursion:**
When function is called within the same function, it is known as **recursion** in C++. The function which calls the same function, is known as **recursive** function
46
New cards
Source Code
______ is the human-readable form of a C++ program. It can’t be run until it is compiled and linked.
47
New cards
Library
A ____ is a collection of linkable files that provide useful functions and classes that you can rely on in your programs.
48
New cards
function
A_____ is a block of code that performs a task, such as multiplying two numbers or displaying a text.
49
New cards
class
A _____ is the definition of a new type of data and related functions.
50
New cards

1. Open Dev C++
2. Open New Source File
3. Write your C++ code in workspace
4. Save, Compile and Run
5. Display the error or output
Steps in creating C++ program
51
New cards
* Single-Line Comment
* Multiple-Line Comment
Two types of comments
52
New cards
Single-Line Comment
starts with the pair of symbols // .Two slash signs indicate that the rest of the line is a comment inserted by the programmer but which has no effect on the behavior of the program.
53
New cards
Multiple-line Comments
enclosed between /\* and \*/.  The compiler ignores anything that appears between the comments.
54
New cards
**#include **
Header file library that lets us work with input object (cin function) and output object (count function)
55
New cards
preprocessor
They are special lines interpreted before the compilation of the program itself begins.
56
New cards
hash sign (#)
Lines beginning with a _____ are directives read and interpreted by what is known as the preprocessor
57
New cards
directives read
Lines beginning with a hash sign **(#)** are _____ and interpreted by what is known as the preprocessor
58
New cards
**using namespace std;**
Which indicates to the system where the standard library is.
59
New cards
**“std”**
**__** is an abbreviation for standard
60
New cards
**main ()**
This line initiates the declaration of a function- a group of code statements which are given a name:
61
New cards
open brace ({)
The ___ at line 5 indicates the beginning of main's function definition,
62
New cards
closing brace (})
the ____ at line 7, indicates the end of the function.
63
New cards
TRUE
Every C++ statement ends with a semicolon.
64
New cards
**\n** and **endl** , \\n
Both __ __are used to break lines. However,__ _ is used more often and is the preferred way.
65
New cards
FALSE

Correct:

Programming in C++ does not require a graphics environment, and C++ programs do not incur runtime expense from type checking or garbage collection.
Programming in C++ does equire a graphics environment, and C++ programs do incur runtime expense from type checking or garbage collection.
66
New cards
C with Classes
What does C++ mean?
67
New cards
C++
has held a spot among the world’s top programming languages for decades and still remains a contemporary and useful choice for software development on desktop computers, servers, embedded devices like phones and many other computing environments.
68
New cards
C++
Originally, it was designed as an improvement upon the C programming, which was developed by Bell Labs.
69
New cards
C
It gained a large following, in part due to its use in the development of the UNIX operating system.
70
New cards
1982
When is ANSI created?
71
New cards
American National Standards Institute (ANSI) committee
Meaning of ANSI?
72
New cards
1989
When was the standard for the C language is created?
73
New cards
**1983**
In **____**, Stroustrup’s contributions officially became known as C++, its name stemming from C and adding the ++ (increment) operator.
74
New cards
1998
When was the international standard for C++ is established?
75
New cards
CPL-Combined Programming Language
Programming language created in 1963
76
New cards
CPL-Combined Programming Language
CPL means?
77
New cards
BCPL- Basic Combined Programming Language
BCPL means?
78
New cards
Members of University Mathematical of London & Cambridge
Who invented CPL?
79
New cards
Cambridge University
Where was the CPL invented?
80
New cards
BCPL  -Basic Combined Programming Language
Programming language created in 1967
81
New cards
Martin Richards
Who invented BCPL?
82
New cards
Algol 58
Programming language created in 1958
83
New cards
Algol 60
Programming language created in 1960
84
New cards
Algol 68
Programming language created in 1968
85
New cards
John Backus
Who invented Algol 58?
86
New cards
Peter Naur
Who invented Algol 60?
87
New cards
Van Wijngaarden
Who invented Algol 68?
88
New cards
Cambridge University
Where was the BCPL invented?
89
New cards
Europe & US
Where was the Algol invented?
90
New cards
B
Programming language created in 1970
91
New cards
C
Programming language created in 1972
92
New cards
C++
Programming language created in 1980’s
93
New cards
Dennis Ritchie
Who invented C?
94
New cards
Ken Thompson
Who invented B?
95
New cards
Classes
extension of the struct construct in C
96
New cards
* C++ program
is a collection of functions.
97
New cards
TRUE
* Every C++ program has a function called main.

TRUE or FALSE
98
New cards
* OOP (Object-Oriented Programming)
* Platform or Machine Independent/ Portable
* Simple
* Mid-level programming language
* Case sensitive
* Compiler-Based
* DMA (Dynamic Memory Allocation)
* Rich Library
* Fast
* Recursion
Enumerate features of C++.
99
New cards
* .cpp (most common)
* .cxx
* .c
* .cp
Enumerate file extensions of C++.
100
New cards
**.cpp**
extension which is the most common choice for C++ programmers and the default for some compilers