100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4,6 TrustPilot
logo-home
Overig

COS2614 Assignment 1 Year 2023 Solutions + Output + Explaination

Beoordeling
-
Verkocht
-
Pagina's
6
Geüpload op
08-06-2023
Geschreven in
2022/2023

Complete Solutions to COS2614 Assignment 1 for the year 2023. Includes Code, Output of run-time, and Explaination.

Instelling
Vak








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

Geschreven voor

Instelling
Vak

Documentinformatie

Geüpload op
8 juni 2023
Aantal pagina's
6
Geschreven in
2022/2023
Type
Overig
Persoon
Onbekend

Onderwerpen

Voorbeeld van de inhoud

Question 1:

Output:




Explaination:
1. The program starts by importing the necessary modules from PyQt5 for creating the GUI.

2. The generate_username function takes the full name as input and splits it into separate first
name and surname components.

3. If the surname has four or more characters, the username is created by taking the first four
characters of the surname and appending the first character of the first name.

4. If the surname has fewer than four characters, the username is created by combining the entire
surname with as many characters as needed from the first name to reach a total length of five
characters.

5. If the resulting username is less than five characters, it appends the required number of zeros
to reach a length of five characters.

6. The generate_password function takes the full name as input, removes any spaces, and
randomly selects five characters from the remaining characters to create the password.

7. The main part of the code creates a Qt application and prompts the user to enter their full
name using a QInputDialog.

8. The entered full name is used to generate the username and password by calling the respective
functions.

9. The generated username and password are displayed in a QMessageBox as an information
message.

10. When the program is run, it displays a dialog for the user to enter their full name. After
entering the name and clicking OK, a message box appears showing the generated username
and password.

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.
Learn2Progress Learn2Progress
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
75
Lid sinds
3 jaar
Aantal volgers
63
Documenten
15
Laatst verkocht
1 jaar geleden

4,6

5 beoordelingen

5
4
4
0
3
1
2
0
1
0

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