Final Exam Review CS 1101 Programming Fundamentals Questions And Answers (Verified And Updated)
Final Exam Review CS 1101 Programming Fundamentals Questions And Answers (Verified And Updated) What output will the following Python program produce? n = 10000 count = 0 while n: count = count + 1 n = n / 10 n=int(n) print(count) - answer5 What output will the following Python commands produce? >>> percentage = float ( 60 * 100) / 55 >>> print (percentage) - answer109. What does the following Python 3 function do? def subroutine(n): while n > 0: print (n,) n -= 1 - answerCounts from n down to 1 and displays each number What is the output of the following Python 3 statements? x=1 y=2 if x == y: print (x, "and", y, "are equal") else: if x < y: print (x, "is less than", y) else: print (x, "is greater than", y) - answer1 is less than 2 The statements inside of a Python loop are known as the ____ of the loop. - answerbody What is the output of the following Python program? pi = int(3.14159) print (pi) - answer3 What output will the following interactive Python statements produce? >>> n = 2 >>> n += 5 >>> n - answer7 What output will the following Python 3 program produce? x = 5 if x % 2 == 0: print (x) else: print (x, x%2) - answer5 1 What is the value of the variable index after the Python code below is executed? word = 'bAnana' index = ('a') - answer3 Repeated execution of a set of programming statements is called repetitive execution. Select one: - answerFalse With built in functions, it is generally acceptable to take a "Leap of Faith". - answerTrue Match the following terms and definitions The order in which statements are executed during a program run. Answer 1 Correct The first part of a compound statement begins with a keyword and ends with a colon ( : ) Answer 2 Correct A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses. Answer 3 Correct A variable defined inside a function that can only be used inside its function. Answer 4 Correct A graphical representation of functions, their variables, and the values to which they refer. Answer 5 Correct - answerThe correct answer is: The order in which statements are executed during a program run. → flow of execution, The first part of a compound statement begins with a keyword and ends with a colon ( : ) → header, A statement that executes a function. It consists of the name of the function followed by a list of arguments enclosed in parentheses. → function call, A variable defined inside a function that can only be used inside its function. → local
Geschreven voor
- Instelling
- CS 1101
- Vak
- CS 1101
Documentinformatie
- Geüpload op
- 27 mei 2024
- Aantal pagina's
- 13
- Geschreven in
- 2023/2024
- Type
- Tentamen (uitwerkingen)
- Bevat
- Vragen en antwoorden
Onderwerpen
-
final exam review cs 1101 programming fundamentals