Garantie de satisfaction à 100% Disponible immédiatement après paiement En ligne et en PDF Tu n'es attaché à rien 4,6 TrustPilot
logo-home
Examen

Computer Science 170 Midterm || All Answers Are Correct 100%.

Note
-
Vendu
-
Pages
5
Grade
A+
Publié le
25-03-2025
Écrit en
2024/2025

How would you display the message "Hello" on the console. correct answers print("Hello") How would you assign the product of hourlySalary and hoursWorked to variable earnings. correct answers earnings = hourlySalary*hoursWorked Determine the output produced by the lines of code. 1). 1 num = 4 2). if num = 9: 3). print("Less than ten.") 4). else: 5). if num == 4: 6). print("Equal to four.") correct answers # Less than ten. Determine the output produced by the lines of code. 1). price = 0 2). age = 17 3). 4). if (age 6): 5). price = 0 6). elif (age = 17): 7). price = 3.75 8). else: 9). price = 5 10 11). print("The price is ", format(price, "0.2f")) correct answers # The price is 3.75. Identify the error Print(Hello) correct answers print("Hello") Identify the error a = 2 b = 3 a + b = c print(c) correct answers c = a + b Identify the error 0.05 = interest balance = 800*interest correct answers interest = 0.05 Write a condition equivalent to the negation of the given condition. (a == b) correct answers (a != b)

Montrer plus Lire moins
Établissement
Computer Science 170
Cours
Computer Science 170

Aperçu du contenu

Computer Science 170 Midterm || All Answers Are Correct
100%.
How would you display the message "Hello" on the console. correct answers print("Hello")

How would you assign the product of hourlySalary and hoursWorked to variable
earnings. correct answers earnings = hourlySalary*hoursWorked

Determine the output produced by the lines of code.
1). 1 num = 4
2). if num <= 9:
3). print("Less than ten.")
4). else:
5). if num == 4:
6). print("Equal to four.") correct answers # Less than ten.

Determine the output produced by the lines of code.
1). price = 0
2). age = 17
3).
4). if (age < 6):
5). price = 0
6). elif (age <= 17):
7). price = 3.75
8). else:
9). price = 5
10
11). print("The price is ", format(price, "0.2f")) correct answers # The price is 3.75.

Identify the error
Print(Hello) correct answers print("Hello")

Identify the error
a=2
b=3
a+b=c
print(c) correct answers c = a + b

Identify the error
0.05 = interest
balance = 800*interest correct answers interest = 0.05

Write a condition equivalent to the negation of the given condition.
(a == b) correct answers (a != b)

, Write a condition equivalent to the negation of the given condition.
(a < b) correct answers (a >= b)

Write a condition equivalent to the negation of the given condition.
(c != d) correct answers (c == d)

What does this code do?
number1, number2, result = 0, 0, 0
number1 = 5*(4+6)
number2 = 2^2
result = number1\number2 correct answers number1 = 50
number2 = 4
result = 12

Improve/Simplify the code.
1).if (j == 7):
b=1
else:
if (j != 7) :
b = 2 correct answers if (j == 7):
b=1
else:
b=2

Improve/Simplify the code.
if not (answer !="y"):
print("Yes")
else:
if (answer == "y") or (answer == "Y"):
print("Yes") correct answers if (answer == "Y" or answer == "y")
print("Yes")

Declare variables used in steps b) - d), and initialize them to 0. correct answers price,
discountPercent, markDown = 0, 0, 0

Assign the value 19.95 to the variable price. correct answers price = 19.95

Assign the value 30 to the variable discountPercent. correct answers discountPercent = 30

Assign the value of (discountPercent divided by 100) times
price to the variable markDown. correct answers markDown = prince*discountPercent/100

Decrease price by markdown. correct answers price = price - markDown

print the value of price on the console and format it with two decimal points. correct answers
print("The price is", format(price, "0.2f"))

École, étude et sujet

Établissement
Computer Science 170
Cours
Computer Science 170

Infos sur le Document

Publié le
25 mars 2025
Nombre de pages
5
Écrit en
2024/2025
Type
Examen
Contient
Questions et réponses

Sujets

Faites connaissance avec le vendeur

Seller avatar
Les scores de réputation sont basés sur le nombre de documents qu'un vendeur a vendus contre paiement ainsi que sur les avis qu'il a reçu pour ces documents. Il y a trois niveaux: Bronze, Argent et Or. Plus la réputation est bonne, plus vous pouvez faire confiance sur la qualité du travail des vendeurs.
SirAnton NURSING, ECONOMICS, MATHEMATICS, BIOLOGY, AND HISTORY MATERIALS BEST TUTORING, HOMEWORK HELP, EXAMS, TESTS, AND STUDY GUIDE MATERIALS WITH GUARANTEED A+ I am a dedicated medical practitioner with diverse knowledge in matters
Voir profil
S'abonner Vous devez être connecté afin de suivre les étudiants ou les cours
Vendu
757
Membre depuis
3 année
Nombre de followers
439
Documents
37473
Dernière vente
2 jours de cela
Reign Supreme Scholarly || Enlightened.

Get your revised study materials available here and elevate your educational outcomes. I have numerous verified learning materials (Research, Exams Questions and answers, Assignments, notes etc) for different courses guaranteed to boost your academic results. I am dedicated to offering you the best and unique learning content. You are encouraged to inquire further assistance from this end whenever need be. Kindly remember to leave your review, understanding your satisfaction is essential . We highly appreciate clients who always come back for more of the study content we offer, you are extremely valued. All the best.

Lire la suite Lire moins
3.7

114 revues

5
49
4
20
3
22
2
8
1
15

Documents populaires

Récemment consulté par vous

Pourquoi les étudiants choisissent Stuvia

Créé par d'autres étudiants, vérifié par les avis

Une qualité sur laquelle compter : rédigé par des étudiants qui ont réussi et évalué par d'autres qui ont utilisé ce document.

Le document ne convient pas ? Choisis un autre document

Aucun souci ! Tu peux sélectionner directement un autre document qui correspond mieux à ce que tu cherches.

Paye comme tu veux, apprends aussitôt

Aucun abonnement, aucun engagement. Paye selon tes habitudes par carte de crédit et télécharge ton document PDF instantanément.

Student with book image

“Acheté, téléchargé et réussi. C'est aussi simple que ça.”

Alisha Student

Foire aux questions