• ¿Documento equivocado? Cámbialo gratis
  • Escrito por estudiantes que aprobaron
  • Inmediatamente disponible después del pago
  • Leer en línea o como PDF
Vender
¿Dónde estudias?
Tu idioma
Document preview thumbnail
Vista previa 2 fuera de 12 páginas
Examen

DEAF 310 Homework 5.1 to 5.4 Solution

Document preview thumbnail
Vista previa 2 fuera de 12 páginas

DEAF 310 Homework 5.1 to 5.4 Solution

Vista previa del contenido

DEAF 310 Homework 5.1 to 5.4 Solution
"Clunker Motors Inc. is recalling all vehicles in its Extravagant line
from model years 1999-2002. Given variables modelYear and
modelName write a statement that assigns True to recalled if the
values of modelYear and modelName match the recall details and
assigns false otherwise." ---100%Correct Answers--- "write a
statement that assigns True to recalled"
recalled =
"values of modelYear and modelName match the recall details"
this means that 1999<= modelYear<= 2002 and modelName ==
"Extravagant"
code:
recalled = 1999<= modelYear<=2002 and modelName ==
"Extravagant"

"Clunker Motors Inc. is recalling all vehicles in its Extravagant line
from model years 1999-2002. Given a variable modelYear and a
String modelName write a statement that prints the message
"RECALL" to standard output if the values of modelYear and
modelName match the recall details." ---100%Correct Answers--
- if (1999<=modelYear<=2002 and
modelName=="Extravagant"):
print("RECALL")



"Write a conditional that assigns True to fever if temperature is
greater than 98.6." ---100%Correct Answers--- conditional: if,
then statement
so need to be using if : format-

code:
if temperature > 98.6: fever = True

, conditional format ---100%Correct Answers--- if *****:

"Write a conditional that multiplies the value associated with pay
by one-and-a-half if worked_overtime is associated with True." ---
100%Correct Answers--- if worked_overtime == True: pay=
pay*1.5
or can do
if worked_overtime == True: pay*=1.5

"Given x and y, each associated with an int, write a fragment of
code that associates the larger of these with another variable
named max." ---100%Correct Answers--- if x > y:
max=x
else:
max=y
"Assume that the variables gpa, deansList and studentName,
have been initialized. Write a statement that adds 1 to deansList
and prints studentName to standard out if gpa exceeds 3.5." ---
100%Correct Answers--- if gpa>3.5:
deansList+=1
print(studentName)

"Assume that isIsosceles is a boolean variable , and that the
variables isoCount,triangleCount, and polygonCount have all
been initialized. Write a statement that adds 1 to each of these
count variables (isoCount,triangleCount, and polygonCount)if
isIsosceles is true." ---100%Correct Answers--- if isIsosceles
== True:
isoCount +=1
triangleCount += 1
polygonCount +=1

"Clunker Motors Inc. is recalling all vehicles from model years
1995-1998 and 2004-2006. Given a variable modelYear write a

Información del documento

Subido en
9 de junio de 2025
Número de páginas
12
Escrito en
2024/2025
Tipo
Examen
Contiene
Preguntas y respuestas
$16.49

¿Documento equivocado? Cámbialo gratis Dentro de los 14 días posteriores a la compra y antes de descargarlo, puedes elegir otro documento. Puedes gastar el importe de nuevo.
Escrito por estudiantes que aprobaron
Inmediatamente disponible después del pago
Leer en línea o como PDF

Vendido
1
Seguidores
0
Artículos
106
Última venta
1 año hace




Por qué los estudiantes eligen Stuvia

Creado por compañeros estudiantes, verificado por reseñas

Calidad en la que puedes confiar: escrito por estudiantes que aprobaron y evaluado por otros que han usado estos resúmenes.

¿No estás satisfecho? Elige otro documento

¡No te preocupes! Puedes elegir directamente otro documento que se ajuste mejor a lo que buscas.

Paga como quieras, empieza a estudiar al instante

Sin suscripción, sin compromisos. Paga como estés acostumbrado con tarjeta de crédito y descarga tu documento PDF inmediatamente.

Student with book image

“Comprado, descargado y aprobado. Así de fácil puede ser.”

Alisha Student

Preguntas frecuentes