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

CPEN 333 – Midterm Exam Questions with 100% Correct Answers 2024

Beoordeling
-
Verkocht
-
Pagina's
17
Cijfer
A+
Geüpload op
20-03-2024
Geschreven in
2023/2024

CPEN 333 – Midterm Exam Questions with 100% Correct Answers 2024 What is an Operating System? - answerA program that acts as an intermediary between a user of a computer and the computer hardware, and provides an environment in which a user can execute programs. What are the goals of an Operating System? - answer Execute user programs and make solving user problems easier; Make the computer system convenient to use; Use the computer hardware in an efficient manner. Real-Time System classifications include? - answer Hard real-time systems - task must be serviced by its deadline Soft real-time systems - no definitive guarantee as to when the critical real-time process will be scheduled (system degradation) "Python Fundamentals" Learning Goals - answer Describe the general structure of a python program Declare and use variables Design branching structures (if, if-else, nested if, elif) Design repetition structures (for, while, while-else) Design functions and modules Use built-in functions Python is classified as an _________ language - answerinterpreted To comment multiple lines, we can use three quotes/double quotes called a __________ - answerdocstring (usually used as a first statement in a function, class, module ... as documentation comment.) Ex. """ This function periodically controls the LEDs based on the required pattern.""" Is Python case sensitive? (is x != X ?) - answeryes Python is dynamically typed. What does it mean? - answerThe interpreter type checks at runtime, and the type of a variable is allowed to change over its lifetime. What mechanism helps with readability and allow us to have better type checking (by checkers, IDEs, linters, etc)? - answerType hints Ex. grade: int = 1 text: str = "Excellent" threshold: float = 1.5 But this is just effectively a comment meant for readability. Python doesn't care about it. To indicate a block of code, what does Python require? - answerIndentation Is the following code allowed? for _ in range(3): - answerYes, _ is a general purpose throwaway variable Is there a need for parenthesis for the condition of an if statement? - answerNo, it is optional What keyword do we use to define/create a function/method? - answerdef Examples of functions - answerdef func1() -> None: def func2(a: float, b: float) -> None: print(a,"+",b,"=",a + b) def func3(a: float, b: float) -> float: Arithmetic Operators - answer+ Addition - Subtraction * Multiplication / Division % Modulus ** Exponentiation (important, as it is not ^) // Floor division (important, to ensure result is an integer) What is an identity operator and a membership operator? - answeris = Identity operator (returns True if both are the same object). Ex. x is y in = Membership operator (returns True if the specified value is present in (a member of) the object). Ex. x in y What file does Python put related definitions (functions, classes, variables) into? - answermodule (Ex. math, tkinter, threading, os, socket, ...) We can also create our own module by storing our own function or class definitions in a file (with extension .py) What is the difference between import versus from-import? - answerImport = imports the entire module (Ex. root = tkinter.Tk()) From-import = imports just the specified function, being able to use it without stating the module first (Ex. root = Tk()) (doesn't need tkinter) What is if __name__ == "__main__": ? - answerIf this file is the one being run directly (as opposed to being imported), then run the statements in the if body. __name__ (two underscores preceding and following) is an internal variable that holds the name of the current module. __main__ is the name of the top-level environment of a program, but when a python module is imported, __name__ is set to the module's name. This allows a program to be directly run or be safely imported (or for unit testing purposes). What does a semicolon do in Python? - answerDenotes separation (instead of putting code in a new line; usually not a good style) What does [] indicate? - answerList What does {} indicate? - answerSet or dictionary List initialization examples - answerlist1 = [] # create an empty list list2 = [2,3,4] # create a list with elements 2, 3, 4 list3 = ["red","green"] # create a list with strings list4 = [2,"three",4] # A list can contain mixed types two = list4[0] # stores 2 (element 0 of list4 in two) d(5) # modifies list2 to have 2, 3, 4, 5 Object-Oriented Programming (OOP) Learning Goals - answer Design classes and define objects Use python data types, e.g. list

Meer zien Lees minder
Instelling
CPEN
Vak
CPEN










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

Geschreven voor

Instelling
CPEN
Vak
CPEN

Documentinformatie

Geüpload op
20 maart 2024
Aantal pagina's
17
Geschreven in
2023/2024
Type
Tentamen (uitwerkingen)
Bevat
Vragen en antwoorden

Onderwerpen

€11,48
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten


Ook beschikbaar in voordeelbundel

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.
TheStar Florida State University
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
607
Lid sinds
2 jaar
Aantal volgers
178
Documenten
24049
Laatst verkocht
19 uur geleden
Stuvia Prodigy

Tested, Verified and Updated Study Materials with 100% Guaranteed Success.

3,8

121 beoordelingen

5
58
4
21
3
21
2
4
1
17

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 iDeal of creditcard en download je PDF-document meteen.

Student with book image

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

Alisha Student

Veelgestelde vragen