C++ Variables and Data Types

C++ Variables and Data Types

Assessment

Quiz

Computers

8th Grade - University

Practice Problem

Medium

Used 232+ times

FREE Resource

Student preview

quiz-placeholder

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which best describes a variable?

Variables store program data while code runs
Variables control memory space
Variables are individual values in a database table
Variables enable programmers to work with different input devices

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following is false?

Variable values can change while a program runs
Variables make it possible to process almost any kind of data
All variables use the same amount of memory
Variables must be stored in a database or file if they are to be retained when the program ends

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

To use the value of a variable you need to know:

The size of the memory used by its data type
The source of the data being stored
The physical address location in memory
A name to reference the data type

4.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Media Image

Which of the following data types CANNOT store the number 47,255?

double
int
String
char

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

In C++ the syntax to declare a variable is:
  datatype variablename;
Which of the following
C++ declarations are invalid?

bool lives;
integer intScore; 
char Broiled; 
double DeCtuRn;

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which holds integers or real numbers with 8 bytes of memory allocated?

int
double
bool
String

7.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

Which holds alphanumerics using character encoding? (size varies)

bool
int
decimal
String

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?