Geschreven door studenten die geslaagd zijn Direct beschikbaar na je betaling Online lezen of als PDF Verkeerd document? Gratis ruilen 4,6 TrustPilot
logo-home
Document preview thumbnail
Voorbeeld 4 van de 51 pagina's
Samenvatting

Samenvatting WPO Bedrijfsinformatica (alle oefeningen + oplossingen)

Document preview thumbnail
Voorbeeld 4 van de 51 pagina's

In dit document vind je alle oefeningen met de daarbij horende oplossingen terug samengevat in 1 enkel document. De oefeningen betreffen alle wpo's gezien in het academiejaar met assistent Mathias Hanson.

Voorbeeld van de inhoud

Bedrijfsinformatica wpo’s H3-H9


H3: Python – data types en operatoren


Average Electricity Bill

My electricity bills for the last three months have been € 23, € 32 and € 64. What
is the average monthly electricity bill over the three-month period? Write an
expression to calculate the mean, and use print() to view the result.

# Write an expression that calculates the average of 23, 32 and 64
# Place the expression in this print statement
print((23 + 32 + 64)/3)




Calculations for a tiler

Two parts of a floor need tiling. One part is 9 tiles wide by 7 tiles long, the
other is 5 tiles wide by 7 tiles long. Tiles come in packages of 6.
- How many tiles are needed?
- You buy 17 packages of tiles containing 6 tiles each. How many tiles will be left
over?

# Fill this in with an expression that calculates how many tiles are needed.
print(9*7 + 5*7)

# Fill this in with an expression that calculates how many tiles will be left over.
print(17*6 - (9*7 + 5*7))




1

,Assign and Modify Variables

After each comment write a line of code that implements the instruction.
Note that this code uses scientific notation to define large numbers. 4.445e8 is
equal to 4.445 * 10 ** 8 which is equal to 444500000.0.

# The current volume of a water reservoir (in cubic metres)
reservoir_volume = 4.445e8

# The amount of rainfall from a storm (in cubic metres)
rainfall = 5e6

# decrease the rainfall variable by 10% to account for runoff
rainfall *= .9

# add the rainfall variable to the reservoir_volume variable
reservoir_volume += rainfall

# increase reservoir_volume by 5% to account for stormwater that flows
# into the reservoir in the days following the storm
reservoir_volume *= 1.05

# decrease reservoir_volume by 5% to account for evaporation
reservoir_volume *= 0.95

# subtract 2.5e5 cubic metres from reservoir_volume to account for water
# that's piped to arid regions.
reservoir_volume -= 2.5e5

# print the new value of the reservoir_volume variable
print(reservoir_volume)




2

,Which is denser, Rio or San Francisco?

Try comparison operators in this quiz! This code calculates the population
densities of Rio de Janeiro and San Francisco.
Write code to compare these densities. Is the population of San Francisco more
dense than that of Rio de Janeiro? Print True if it is and False if not.

sf_population, sf_area = 864816, 231.89
rio_population, rio_area = 6453682, 486.5
san_francisco_pop_density = sf_population/sf_area
rio_de_janeiro_pop_density = rio_population/rio_area

# Write code that prints True if San Francisco is denser than Rio, and False otherwise
print(san_francisco_pop_density > rio_de_janeiro_pop_density)

# Note: other solutions are possible, like the one below, but take a moment to make sure
you understand and appreciate the concise efficiency of the one line above!
if (san_francisco_pop_density > rio_de_janeiro_pop_density):
print (True)
else:
print (False)




3

, Write a Server Log Message

Youve learned to print a log message like this one (with the username, url, and timestamp
replaced with values from the appropriate variables):
John.McAfee accessed the site https://canvas.vub.be/courses/234097 at 12:53.

username = "Elizabeth.Smith"
timestamp = "09:11"
url = "https://canvas.vub.be/courses/189241"

# TODO: print a log message using the variables above.
print (username + " accessed the site " + url + " at " +
timestamp + ".")




Use string concatenation and the len() function to find the length of a certain
movie star's actual full name. Store that length in the name_length variable.
Don't forget that there are spaces in between the different parts of a name!

given_name = "William"
middle_names = "Bradley"
family_name = "Pitt"

# TODO: calculate how long this name is of name_length
name_length = len(given_name + " " + middle_names + " " +
family_name)
name_length = len(given_name) + len(middle_names) +
len(family_name) + 2


# Now we check to make sure that the name fits within the driving license character limit
# Nothing you need to do here
driving_license_character_limit = 28
print(name_length <= driving_license_character_limit)




4

Documentinformatie

Geüpload op
12 september 2023
Aantal pagina's
51
Geschreven in
2022/2023
Type
Samenvatting
€6,19

Verkeerd document? Gratis ruilen Binnen 14 dagen na aankoop en voor het downloaden kan je een ander document kiezen. Je kan het bedrag gewoon opnieuw besteden.
Geschreven door studenten die geslaagd zijn
Direct beschikbaar na je betaling
Online lezen of als PDF

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.
insd
4,5
(2)
Verkocht
35
Volgers
14
Items
4
Laatst verkocht
1 week geleden



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

Bezig met je bronvermelding?

Maak nauwkeurige citaten in APA, MLA en Harvard met onze gratis bronnengenerator.

Bezig met je bronvermelding?

Veelgestelde vragen