FREE! Click here to Join FunTrivia. Thousands of games, quizzes, and lots more!
Quiz about Oh Say Can You C Version 10
Quiz about Oh Say Can You C Version 10

Oh Say Can You C++, Version 1.0 Quiz


First in a series of quizzes on the programming language C++. This installment covers general programming concepts and some basic C++. It is intended for those who have little or no programming experience.

A multiple-choice quiz by slipnslide. Estimated time: 3 mins.
  1. Home
  2. »
  3. Quizzes
  4. »
  5. Science Trivia
  6. »
  7. Computers
  8. »
  9. Software and Programming

Author
slipnslide
Time
3 mins
Type
Multiple Choice
Quiz #
241,023
Updated
Dec 03 21
# Qns
10
Difficulty
Average
Avg Score
8 / 10
Plays
2466
Last 3 plays: Guest 208 (8/10), Matthew_07 (9/10), Guest 50 (7/10).
- -
Question 1 of 10
1. What is a computer program? Hint


Question 2 of 10
2. The central processing unit or CPU is the heart of a computer. Its job is to fetch instructions, follow those instructions, and then produce a result. But, the CPU can only follow instructions that are written in what is called machine language. If you were to look at a program written in machine language what would you see? Hint


Question 3 of 10
3. It would be tedious for human beings to write programs using nothing but binary code. For this reason, computer programming languages which use words instead of numbers were invented. Special software is used to convert programs written in these higher level languages into machine language. What is the generalized name for the type of special software that is used to convert source code that is written in C++? Hint


Question 4 of 10
4. There are elements that are common to nearly all programming languages. They can be classified as key words, programmer defined symbols, operators, and punctuation. A language's syntax dictates how these elements are used. Which of these choices would be considered an operator in C++? Hint


Question 5 of 10
5. Variables are programmer defined symbols. But, in C++ terms, what is a variable? Hint


Question 6 of 10
6. Statement is also an important term in programming. Which of these choices best defines it? Hint


Question 7 of 10
7. What form of punctuation must end all C++ statements? Hint


Question 8 of 10
8. Variables in C++ are classified by their data type. The data type determines the kind of information that the variable can store. Which of these C++ variable types would be the most obvious choice for storing a whole number? Hint


Question 9 of 10
9. Which of these C++ variable types can be used to store a floating point number? Hint


Question 10 of 10
10. If you looked at some C++ source code, near the top you would likely see a line of code that starts with a #. What does that symbol indicate? Hint



(Optional) Create a Free FunTrivia ID to save the points you are about to earn:

arrow Select a User ID:
arrow Choose a Password:
arrow Your Email:




Most Recent Scores
Dec 13 2024 : Guest 208: 8/10
Dec 02 2024 : Matthew_07: 9/10
Nov 28 2024 : Guest 50: 7/10
Nov 22 2024 : Guest 174: 10/10
Nov 12 2024 : Guest 129: 9/10
Oct 27 2024 : lg549: 9/10

Score Distribution

quiz
Quiz Answer Key and Fun Facts
1. What is a computer program?

Answer: A set of instructions that a computer follows in order to complete a task.

I hope that you got this one right. A computer cannot think. It simply follows the step-by-step instructions provided by the program and then halts to await further orders. The overall design of a program is guided by an algorithm, which is the plan that is used by the programmer to break down and solve a given problem.
2. The central processing unit or CPU is the heart of a computer. Its job is to fetch instructions, follow those instructions, and then produce a result. But, the CPU can only follow instructions that are written in what is called machine language. If you were to look at a program written in machine language what would you see?

Answer: A stream of ones and zeroes.

It's binary code and it's the only thing that your computer "knows". The CPU interprets these numbers as commands. It is implemented by differences in voltage levels. For instance, a higher voltage level can be used to represent a 1 and a lower voltage level can be used to represent a 0.
3. It would be tedious for human beings to write programs using nothing but binary code. For this reason, computer programming languages which use words instead of numbers were invented. Special software is used to convert programs written in these higher level languages into machine language. What is the generalized name for the type of special software that is used to convert source code that is written in C++?

Answer: compiler

The conversion is actually a three phase process: preprocessing, compiling, and linking. But, it's usually just called compiling and the software is referred to as a compiler.
4. There are elements that are common to nearly all programming languages. They can be classified as key words, programmer defined symbols, operators, and punctuation. A language's syntax dictates how these elements are used. Which of these choices would be considered an operator in C++?

Answer: =

In C++, a single = sign is known as the assignment operator. It assigns a value to a variable. A variable, in turn, would be classified as a programmer defined symbol. The , and the ; would be classified as punctuation.
5. Variables are programmer defined symbols. But, in C++ terms, what is a variable?

Answer: A symbolic name that represents a location in the computer's memory.

Variables are where information is stored. Variable names should always be meaningful. For example, if you were storing a person's age in a variable, a good name for that variable (aka memory location) would be age, not x or y or grasshoppper or bicycle or....well, you get the idea.
6. Statement is also an important term in programming. Which of these choices best defines it?

Answer: A complete instruction that causes the computer to perform some action.

Statements can be any combination of elements. Of course, the statement must be syntactically correct in order for the program to compile. You should know what that means by now!
7. What form of punctuation must end all C++ statements?

Answer: ;

The semicolon indicates the end of a statement. I work in a university computer lab and I have learned that leaving off a semicolon is the most common syntax error made by novice programmers.
8. Variables in C++ are classified by their data type. The data type determines the kind of information that the variable can store. Which of these C++ variable types would be the most obvious choice for storing a whole number?

Answer: int

The keyword int stands for integer. An integer is a whole number. There are actually six different variable types that can be used to store an integer depending on the magnitude and sign of the data to be stored, but int is used as sort of the catch-all type.
9. Which of these C++ variable types can be used to store a floating point number?

Answer: double

The keyword float stands for floating point number, which is another term for real numbers. There are two other C++ variable types that can store floating point numbers. They are double and long double. Which one you use is determined by the size of the number to be stored and/or the precision that is desired.
10. If you looked at some C++ source code, near the top you would likely see a line of code that starts with a #. What does that symbol indicate?

Answer: a preprocessor directive

Remember that there are three phases in the process of converting source code into machine language. The first phase is the preprocessing phase and the # symbol indicates a preprocessor directive. Think of the preprocessor as a program that sets up your code for compiling.
Source: Author slipnslide

This quiz was reviewed by FunTrivia editor crisw before going online.
Any errors found in FunTrivia content are routinely corrected through our feedback system.
12/18/2024, Copyright 2024 FunTrivia, Inc. - Report an Error / Contact Us