FOP Module 3

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

(03.03 MC) Read the following code: n = 0 while(n <= 5): print(n)n = n + 1 What output would be produced for the given values of n?

0 1 2 3 4 5

(02.02 LC) Which of the following numeric values is considered a floating point number?

1.6

(03.02 MC) Read the following code: for count in range(80); leo.forward(count * 2) leo.left(count + 2) There is an error in the for loop. What should be fixed?

Change the semicolon to a colon after the statement.

(03.03 MC) Read the following code: x = 1while(x < 50); print(x)x = x + 1 There is an error in the while loop. What should be fixed?

Change the semicolon to a colon at the end of the statement.

(02.03 LC) What is one way programmers benefit from using Python's Math Module?

Create programs faster and easier.

(02.04 MC) Natalia is using the software development life cycle to create a program that will calculate a user's fitness level. She has defined her project goals, created a requirements document, and analyzed the scope of the work. What should she do next?

Design the program by writing pseudocode.

(02.04 LC) What is the most effective way to document version control and change management?

Detailed notes.

(02.04 LC) What is one way programmers notify users of program updates?

Email messages.

(02.04 MC) Jessica and Roberto are using the software development life cycle to develop a career interest app. They defined their project goal and have created a requirements document. What else should they do as part of the planning and analysis step?

Evaluate the scope of the project.

(02.02 LC) In Python, when converting a string value into a numeric value that contains a decimal, the int()function is used.

False.

(3.01 LC) Python's built-in library of functions allows programmers to import pre-written applications.

False.

(03.01 LC) What is one benefit of using Python's Turtle Graphics Module?

Importing pre-written code to draw on the screen makes a programmer's job faster and more efficient.

(02.02 LC) __________ require less memory than __________ because they are positive and negative whole numbers.

Integers, floating points.

(02.04 LC) What is one task related to program maintenance?

Make design and functionality improvements.

(01.03 LC) Which of the following is an example of a syntax error in programming?

Not using quotation marks and parentheses to print a string literal.

(01.02 MC) What is one way interpreted programming languages differ from compiled programming languages?

Programs written with interpreted languages require the original source code, but programs written with compiled languages can be shared with others while keeping the source code private.

(03.03 MC) Read the following code: x = 1 while(x "<" 26): print(x) x = x + 1 There is an error in the while loop. What should be fixed?

Remove quotation marks around the relational operator

(01.03 LC) In programming, what is a string within quotation marks called?

String literal

(02.01 LC) What is the purpose of indexing?

To pull out one specific character from a string.

(01.02 LC) High-level programming languages are used to write a wide variety of programs, like operating systems, scientific modeling, and general applications.

True.

(01.02 LC) Low-level programming languages are used to write code to control the computer's hardware.

True.

(01.03 LC) Logical errors mean the program ran, but the results were not as expected.

True.

(01.04 LC) In Python, programmers use square brackets and an index range to slice multiple characters from a string.

True.

(03.03 LC) In Python, while loops will repeat during the time the test condition is true.

True.

(3.01 LC) Python's built-in function library allows programmers to create code faster and more efficiently.

True.

(3.01 MC) Kendra is creating an app for swimmers. Users will input their race times, and the output will be a graph showing their progress. Which Python library should Kendra use to draw a line on the screen?

Turtle Graphics.

(03.03 LC) What is the proper syntax for writing a while loop in Python?

Use relational operators to indicate test conditions.

(02.04 MC) How does the waterfall method of software development differ from the agile method?

Waterfall project teams work on one step of the development at a time, while agile teams develop smaller portions of the entire project in small sprints.

(03.03 LC) When should the while loop be used in Python?

When the exact number of repetitions is unknown.

(03.02 LC) When is the most appropriate time to use a for loop in Python?

When the exact number of repetitions needed for the loop is known.

(03.03 LC) When is the most appropriate time to use a while loop in Python?

When the exact number of repetitions needed for the loop is unknown.

(02.04 MC) Peter's team has been hired to rapidly develop a program using Python. What is a potential drawback to rapidly developing a program?

Without proper planning or testing, programs created quickly could have many errors.

(02.03 HC) Read the following code: # distance equals the square root of X squared plus Y squared distance = sqrt((pow (x, 2) + pow y, 2) There is an error in the code. How should the code be revised in order to get the correct output?

distance = sqrt(pow(x,2) + pow(y,2))

(03.03 LC) As soon as a while loop condition becomes __________, the loop will __________.

false; end.

(3.01 LC) In order to use Turtle Graphics in Python, program code must include __________.

import turtle

(3.01 LC) Which is an example of a built-in function in Python's library?

input()

(02.02 MC) Read the following code used to calculate the number of buses needed for a field trip: students = input("How many students are attending the field trip?") bus = 30totalBuses = students / bus There is an error in the code. Which additional function needs to be used with the input() function?

int()

(01.04 LC) Which of the following is the proper way to assign a string literal value to a variable in Python?

variableName = "value"


Ensembles d'études connexes

KF 인도네시아인을 위한 종합 한국어 1권 개정판 05과 하루 일과

View Set

Dichotomous Key practice questions

View Set

That Was Then, This Is Now Chapter 4

View Set

Study Guide for Module 6: Science: Geology

View Set