Python Question

    April 21, 2024

MIS 532 – Spring 2024 Assignment 2 Due: 11:59PM February 28, 2024 Instructions: – Please include comments (single line and multiline comments as necessary). The first line of a script includes the assignment and the question number. The next line includes a docstring that describes the purpose of the script (see slide 13 of Control Statements PowerPoint as an example) – Test your programs thoroughly to ensure they execute and produce the correct outputs – Develop the scripts in Jupyter notebook and save solutions to all questions in one .ipynb file. Submit this .ipynb file on Canvas. Q1: Simple Text Encryption (8 points) Using what we have learned so far and the hint below, implement a function to encrypt text using a simple shift, where each letter in the plaintext is ‘shifted’ a certain number of places down or up the alphabet. For example, with a shift of 1, ‘A’ would be replaced by ‘B’, ‘B’ would become ‘C’, and so on. The function should return a new string where each alphabetic character in text has been shifted the specified number of positions in the alphabet. The function can handle both uppercase and lowercase letters. Non-alphabetic characters should remain unchanged in the encrypted text. Write a main function where the user will be prompted to enter the text they want to encrypt and the shift value. Hint: The chr() function is a built-in function that accepts an integer as its argument and returns a string representing a character at that Unicode point. For example, chr(65) would return ‘A’, the character for the Unicode point 65. The ord() function, which is the inverse function of chr() function, returns the integer that represents the Unicode character argument. For example, ord(‘A’) would return 65. Sample output: Q2: Username Checker (10 points) Write a function check_username that validates a username according to the following rules: – The username must not contain any of the following characters: @,

Trust your assignments to an essay writing service with the fastest delivery time and fully original content.

Verified