Algorithms & Programming Fundamentals
If you have declared an integer variable named counter, which option correctly increases its value by one?
counter = counter +1 ;
counter +1 ;
+counter;
counter++ ;
After increasing the size of variables in an algorithm from integer type holding values up to 32,767 (16 bits) to long integers holding much larger values (64 bits), what negative impact might occur during execution?
Longer processing times due to handling larger data sizes
Easier management since most modern systems handle large numbers well
Reduced risk of overflow errors given increased variable capacity
Values exceeding 32,767
What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] print(grocery_list[1])
"milk"
"eggs"
"cheese"
Error
What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] i = 0 while i < len(grocery_list): print(grocery_list[i]) i += 1
"milk", "eggs", "cheese"
milk eggs cheese
Error
"milk", "eggs", "cheese"
What type of variable assignment strategy is critical when constructing a test suite aimed at capturing unexpected behaviors in a complex program’s algorithm?
Assigning static values known to cause no errors or exceptions in processing.
Using only constant literals for ease of understanding expected outcomes.
Utilizing both static and dynamic data types with unpredictable values.
Relying on default variable assignments provided by the programming language used.
What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] grocery_list.append("flour") print(grocery_list)
["milk", "eggs", "cheese"]
["milk", "eggs", "cheese", "flour"]
["milk", "eggs", "flour", "cheese"]
Error
What will be the data type of the variable 'result' if it stores the outcome of 5 / 2 in a language that supports automatic type conversion?
Float or Double (depending on language specifics)
Boolean
Character
String

How are we doing?
Give us your feedback and let us know how we can improve
What is the output of the following code? grocery_list = ["milk", "eggs", "cheese"] i = 0 while i < len(grocery_list): print(grocery_list[i]) i -= 1
["eggs", "cheese", "apples"]
Error
eggs cheese apples
"eggs", "cheese", "apples"
Can you assign the value of one element to another? If no, why not?
This is not an operation that is possible.
Yes, but you have to code a method to do so and define it separately.
Yes
No, because you need a placeholder variable.
What type of data practice involves using variables to store sensitive information like passwords temporarily in a program?
Data normalization
Data mining
Data encapsulation
Data redundancy