100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Tentamen (uitwerkingen)

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

Beoordeling
-
Verkocht
-
Pagina's
5
Cijfer
A+
Geüpload op
25-03-2025
Geschreven in
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)

Meer zien Lees minder
Instelling
Computer Science 170
Vak
Computer Science 170









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Geschreven voor

Instelling
Computer Science 170
Vak
Computer Science 170

Documentinformatie

Geüpload op
25 maart 2025
Aantal pagina's
5
Geschreven in
2024/2025
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

Voorbeeld van de inhoud

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"))

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
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
Bekijk profiel
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
734
Lid sinds
3 jaar
Aantal volgers
437
Documenten
34580
Laatst verkocht
4 weken geleden
Reign Supreme Scholarly || Enlightened.

Here we offer revised study materials to elevate your educational outcomes. We have verified learning materials (Research, Exams Questions and answers, Assignments, notes etc) for different courses guaranteed to boost your academic results. We are dedicated to offering you the best services and you are encouraged to inquire further assistance from our end if need be. Having a wide knowledge in Nursing, trust us to take care of your Academic materials and your remaining duty will just be to Excel. Remember to give us a review, it is key for us to understand our clients satisfaction. We highly appreciate clients who always come back for more of the study content we offer, you are extremely valued. All the best.

Lees meer Lees minder
3.7

110 beoordelingen

5
46
4
20
3
22
2
8
1
14

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via Bancontact, iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo eenvoudig kan het zijn.”

Alisha Student

Veelgestelde vragen