100% satisfaction guarantee Immediately available after payment Both online and in PDF No strings attached 4.2 TrustPilot
logo-home
Exam (elaborations)

D278 QUESTIONS AND VERIFIED SOLUTIONS

Rating
-
Sold
-
Pages
2
Uploaded on
12-08-2025
Written in
2025/2026

What is the purpose of a variable? - A variable stores data that can be used and modified during a program's execution. How do you save a value to a variable? - By using the assignment operator (=), e.g., x = 5. What is a programming expression? - A combination of variables, constants, operators, and functions that evaluates to a value. What is an identifier? - A name used to identify variables, functions, arrays, or other user-defined elements. What constitutes a valid identifier? - Must start with a letter or underscore, followed by letters, digits, or underscores, and cannot be a keyword. What is a literal? - A fixed value in code, such as 5 or "hello". What is an operator? - A symbol that performs operations on variables and values (e.g., +, -, *, /). What precedence rules does programming use? - Defines the order in which operators are evaluated; parentheses > multiplication/division > addition/subtraction. How does an integer differ from a float? - Integers are whole numbers; floats contain decimal points. What happens if you divide two integers?

Show more Read less
Institution
D278
Course
D278








Whoops! We can’t load your doc right now. Try again or contact support.

Written for

Institution
D278
Course
D278

Document information

Uploaded on
August 12, 2025
Number of pages
2
Written in
2025/2026
Type
Exam (elaborations)
Contains
Unknown

Subjects

Content preview

D278 QUESTIONS AND VERIFIED SOLUTIONS
What is the purpose of a variable? - ✔✔A variable stores data that can be used and
modified during a program's execution. How do you save a value to a variable? - ✔✔By
using the assignment operator (=), e.g., x = 5. What is a programming expression? - ✔✔A
combination of variables, constants, operators, and functions that evaluates to a value.
What is an identifier? - ✔✔A name used to identify variables, functions, arrays, or other
user-defined elements. What constitutes a valid identifier? - ✔✔Must start with a letter or
underscore, followed by letters, digits, or underscores, and cannot be a keyword. What is a
literal? - ✔✔A fixed value in code, such as 5 or "hello". What is an operator? - ✔✔A symbol
that performs operations on variables and values (e.g., +, -, *, /). What precedence rules
does programming use? - ✔✔Defines the order in which operators are evaluated;
parentheses > multiplication/division > addition/subtraction. How does an integer differ
from a float? - ✔✔Integers are whole numbers; floats contain decimal points. What
happens if you divide two integers? - ✔✔Integer division gives an integer (in some
languages, it truncates). What happens if you divide an integer and a float? -
✔✔Integer/float returns a float. What happens if you divide a nonzero floating point
number by zero? - ✔✔Typically results in infinity or a runtime error, depending on the
language. How do you convert an item's type? - ✔✔Through type casting, like int(), float(),
or str(). What does the modulo operator do? - ✔✔Returns the remainder of a division (e.g.,
5 % 2 = 1). What is the difference in a variable and a constant? - ✔✔A variable's value can
change; a constant's value cannot. How does an array work? - ✔✔Stores multiple values in
indexed positions. What does index reference? - ✔✔The position of an element in an array,
starting at 0. What is the purpose of each different data type? - ✔✔Defines how data is
stored and what operations can be performed on it. How does a branch differ from a loop?
- ✔✔A branch chooses between alternatives; a loop repeats actions. How does an if-else
branch work? - ✔✔Evaluates a condition and runs one block of code if true, another if
false. What does the equality operator do? - ✔✔Compares two values to see if they are
equal; it generally works across most primitive types. What are the four relational
operators? - ✔✔== (equal), != (not equal), < (less than), > (greater than). What are the three
logical operators? - ✔✔&& (and), || (or), ! (not). Explain the precedence rules. - ✔✔NOT (!)
has the highest precedence, followed by AND (&&), then OR (||). How is an infinite loop
created? - ✔✔When a loop's condition never becomes false. What is a sentinel value? -
✔✔A special value that indicates the end of data entry. What are the three parts of a loop?
- ✔✔Initialization, condition, and update. What is the difference in a while loop and
$15.99
Get access to the full document:

100% satisfaction guarantee
Immediately available after payment
Both online and in PDF
No strings attached

Get to know the seller
Seller avatar
mikemuisyo1968

Get to know the seller

Seller avatar
mikemuisyo1968 Chamberlain College Of Nursing
View profile
Follow You need to be logged in order to follow users or courses
Sold
0
Member since
6 months
Number of followers
0
Documents
148
Last sold
-

0.0

0 reviews

5
0
4
0
3
0
2
0
1
0

Recently viewed by you

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Frequently asked questions