Uncategorized

ENTD220 Week 2

Part I Instructions:
# This is the flower box and it should be at the beginning of each assignment# You must add comments to your code# Program name : Wk2P1_firstname_lastname.py# Student Name : # Course : ENTD220# Instructor : My Instructor# Date : Any Day
# Copy Wrong : This is my workYou are going to create the following:A simple calculator to accept two numbers and print the addition, subtraction, multiplication and division of the two numbers.You are required to store each input number in a separate variable.Hints
1) You should also store each calculation in a variable2) You will get an error if you divide by zero, you will address this problem next assignmentSample outputThis is my first programming assignmentEnter your First number —> 25Enter your Second number —> 14The Result of 25 14=39.0The Result of 25-14=11.0The Result of 25*14=350.0The Result of 25/14=1.78571428571Thanks for using our calculator!
Submission Instructions:
Make sure that you save your code in a text file in this format. Check your file after the upload to see if they are readable. You can paste your code in the student submission text area.
W2P1_firstname_lastname.py
Part II Instructions:
# This is the flower box and it should at the beginning of each assignment# You must add comments to your code# Program name : Wk2P2_firstname_lastname.py# Student Name : Ymmas Azaba# Course : ENTD220# Instructor : My Instructor# Date : Any Day
# Copy Wrong : This is my work
You are going to enhance the prior assignment by doing the following:1) Limit the input range from -100 to 100 for each input number2) Prevent dividing by zero (Do not use try-except)3) Instead of hard coding values from -100 to 100, let the user enter the rangeHints:See sample output for messages.
Sample outputEnter your Lower range —> -100Enter your Higher range —> 100Enter your First number —> 50Enter your Second number —> 20The Result of 50 20=70.0The Result of 50-20=30.0The Result of 50*20=1000.0The Result of 50/20=2.5Thanks for using our calculator!====================================Enter your Lower range —> -50Enter your Higher range —> 50Enter your First number —> 20Enter your Second number —> 0The Result of 20.0 0.0=20.0The Result of 20.0-0.0=20.0The Result of 20.0*0.0=0.0The Result of 20.0/0.0=You cannot divide by ZeroThanks for using our calculator!====================================Enter your Lower range —> 10Enter your Higher range —> 50Enter your First number —> 5Enter your Second number —> 60The input values are out side the input rangesPlease check the numbers and try againThanks for using our calculator