Writing a simple python program which asks the user to input

Assignment Help Python Programming
Reference no: EM133546306

Programming Assignment

Task 1: Academic Integrity reflection

For this task, you are to briefly discuss a scenario involving academic misconduct.

In order to access this assignment, you were asked to read about an Academic Integrity issue and answer related multiple-choice questions, Before continuing on to the main programming tasks, take a moment to reflect on this issue by answering the questions below. If you have forgotten the details of the scenario, refer back to the LIDS quiz as you answer this task.

Questions: Have any of loni, Rohan or Sarni engaged in academic misconduct? Explain. Have their choices led to them learning the subject material better? What could be the possible outcomes for loni, Rohan and Sami now? What could they have done differently?

An attempt has been made at writing a simple Python program which asks the user to input a value for x, and then prints the result of the following mathematical expression:

2+ (1 - x)3

However, as it is currently written the program is not performing the calculation correctly. If you inspect the code, you will notice that this is because the expression has been written without properly considering the operator precedence rules in Python.

Your task is to fix the program by adding a single pair of parentheses to the numerical expression so that it is evaluated in the same way as the mathematical expression described above.

Task 2: Implementing a formula

For this task you are to fix the code implementation of a mathematical formula.

An attempt has been made at writing a simple Python program which asks the user to input a value for x, and then prints the result of the following mathematical expression:

2 + (1 - x)3

[ ] x = float(input('Enter a value for x # TODO: Insert parentheses in the fo y = 2 + (1 - x) ** 3 / 4

print('y = + str(y))

Task 3: Currency conversion

For this task, you are to write a simple currency conversion program.

Your program should ask the user to input a dollar amount in AUD (Australian dollars). Next, your program should ask the user what currency to convert to (e.g., EUR). Finally, your program should look up the appropriate fixed conversion rate from a dictionary constant and display the result to the user.

Your program should ask the user to input a dollar amount in AUD (Australian dollars). Next, your program should ask the user what currency to convert to (e.g., EUR). Finally, your program should look up the appropriate fixed conversion rate from a dictionary constant and display the result to the user.

Your program must include support for the following currencies at the listed conversion rates:
- 1 AUD = 0.59 EUR
- 1 AUD = 0.64 USD
- 1 AUD = 0.87 CAD
- 1 AUD = 1.08 NZD
Additionally, your program must support two more currencies of your choice.

Task 4: Password checker
For this task, you are to write a function which checks that a password is valid.

The rules for a valid password are as follows:
- The password is at least 8 characters long.
- The password is no more than 20 characters long.
- The password contains at least one digit (0-9).
- The password does not contain any duplicate characters.

Your function should print an appropriate message for each condition that is failed, and return a Boolean result (True if the password is valid, False otherwise).

Task 5: Compression
For this task, you are to implement a simple compression algorithm.

The logic for this particular simple compression algorithm is shown in the flowchart attached:

The purpose of the algorithm is to represent text in a way that is more efficient for many repeated characters. See the examples for how this is expected to work.

Using the provided code as a starting point, complete the program so that the behaviour of Python code closely matches the logic of the flowchart.

• Works as expected for the examples and other inputs.

Task 6: YouTube videos

For this task, you are to write a class for representing YouTube videos.

Each YouTube video object should contain the title of the video (e.g., THANTS) as well as the URL of the video (e.g.,

You must also define a method called print_detalls which prints the title alongside the URL.

Task 7: Big "X"

For this task, you are to write a program that displays a big "X".

Imagine that you are working for a popular social media platform which has recently been acquired by a wealthy individual. The new owner has decided to pull you from working on core platform features so that you can instead work on branding. More specifically, you have been
asked to write a program which display a big "X".

Your program should first ask the user which character to draw the big "X" with. Next, it should ask for the size of the "X". Finally, it should display the "X" by displaying the appropriate characters as lines of output.

The above example shows an "X" of size 5 drawn using the character "#". Note that there are 5 lines, and each line is 5 characters wide. The "background" characters are simply spaces (i.e., the character you get when hitting the space bar).
You are guaranteed that the size of the "X" input by the user will be at least 3.

Hint: Consider using a nested loop in your solution. The outer loop repeats once per line, and the inner loop repeats once per character within the current line.

Resetting the Notebook Runtime
Due to the nature of notebooks, old variables, classes, and functions may still be accessible even after they have been removed from the code. This may result in unexpected program behaviour.

To ensure that this isn't the case, you can reset the runtime to reset the Python interpreter state. After doing so, you should run your solutions again to ensure they function correctly.

Attachment:- Programming Assignment.rar

Reference no: EM133546306

Questions Cloud

Evaluate the resources for quality accuracy and effectivenes : Explain how content and skill development can be supported by the resources. Evaluate the resources for quality, accuracy, and effectiveness.
How might the theory help frame your work : How has the theory changed and evolved since its original development? How might this theory help frame your work?
Analyze your standard and gain in-depth knowledge : EDU 501- Analyze your standard and gain in-depth knowledge about what you must teach to mastery to your students.
Create all entities with appropriate attributes : Create all entities with appropriate attributes. Select appropriate data types for all fields. Translate business requirements into integrity constraints.
Writing a simple python program which asks the user to input : Writing a simple Python program which asks the user to input a value for x, and then prints the result of the following mathematical expression
Identify a personal project of your choosing : Identify a personal project of your choosing. This could be a family vacation, plans to clean or organize a part of your living space, etc.
What is the purpose of diffie-hellman protocol : What is the purpose of Diffie-Hellman (DF) protocol? How does DF work by describing the Diffie-Hellman (DH) function and the discrete logarithm problem?
Demonstrate a connection to your current work environment : Demonstrate a connection to your current work environment. If you are not employed, demonstrate a connection to your desired work environment.
Explain key concepts and ideas that you have learnt : Conclude what you can learn from this and how can it be applied in the future such as your learning, work, or career

Reviews

Write a Review

Python Programming Questions & Answers

  Write a python program to implement the diff command

Without using the system() function to call any bash commands, write a python program that will implement a simple version of the diff command.

  Write a program for checking a circle

Write a program for checking a circle program must either print "is a circle: YES" or "is a circle: NO", appropriately.

  Prepare a python program

Prepare a Python program which evaluates how many stuck numbers there are in a range of integers. The range will be input as two command-line arguments.

  Python atm program to enter account number

Write a simple Python ATM program. Ask user to enter their account number, and print their initail balance. (Just make one up). Ask them if they wish to make deposit or withdrawal.

  Python function to calculate two roots

Write a Python function main() to calculate two roots. You must input a,b and c from keyboard, and then print two roots. Suppose the discriminant D= b2-4ac is positive.

  Design program that asks user to enter amount in python

IN Python Design a program that asks the user to enter the amount that he or she has budget in a month. A loop should then prompt the user to enter his or her expenses for the month.

  Write python program which imports three dictionaries

Write a Python program called hours.py which imports three dictionaries, and uses the data in them to calculate how many hours each person has spent in the lab.

  Write python program to create factors of numbers

Write down a python program which takes two numbers and creates the factors of both numbers and displays the greatest common factor.

  Email spam filter

Analyze the emails and predict whether the mail is a spam or not a spam - Create a training file and copy the text of several mails and spams in to it And create a test set identical to the training set but with different examples.

  Improve the readability and structural design of the code

Improve the readability and structural design of the code by improving the function names, variables, and loops, as well as whitespace. Move functions close to related functions or blocks of code related to your organised code.

  Create a simple and responsive gui

Please use primarily PHP or Python to solve the exercise and create a simple and responsive GUI, using HTML, CSS and JavaScript.Do not use a database.

  The program is to print the time

The program is to print the time in seconds that the iterative version takes, the time in seconds that the recursive version takes, and the difference between the times.

Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd