Columbus State Community College Math Calculator Exercise Assignment: Lab Exercise 6 Python: Math Calculator Python Assignment The objectives of this la
Columbus State Community College Math Calculator Exercise Assignment: Lab Exercise 6
Python: Math Calculator
Python Assignment
The objectives of this lab assignment are as follows:
Declare variables
Use comments
Use arithmetic operators
Receive input from the user
Output data to the console
Apply conditional logic
Convert string value to float
Skills Required
To properly complete this assignment, you will need to apply the following skills:
Read string input from the console and convert input to required numeric data-types
Understand the if / elif / else construct
Output information back to the user
Assignment User Story
As a user I want an application that will allow a user to calculate either the sum of two numbers (add), the difference between two numbers (subtract), the product of two numbers (multiply), or the quotient of two numbers (division).
Assignment Requirements
In this application you will prompt the user for one of four math calculations to perform: add, subtract, multiple, divide. Next, you will prompt the user for two numbers with which to operate. You will then perform the appropriate calculation deriving a resulting number. Finally, you will print the calculation performed with the result.
This assignment combines operations of prompting and receiving input from the user with conditional logic to perform a specific function based on those inputs. Finally, this assignment outputs information back to the user.
Important: you must realize that all input received from the user is assigned the data-type of string. Therefore, you must convert the numeric values received from the user to float data-types.
When complete, your output should be as pictured below:
Example of Add operation:
Example of Divide operation:
Example of Invalid option entry:
Technical/Grading Requirements
You must ensure that the application you submit meets all the technical/grading requirements. Your grade will be based on how well your application follows these requirements:
The name of your application will be Calculator.py
You must have a set of comments at the top of the program that identifies the programmer, date, and name of the program file. Furthermore, you must provide a description of what this program is and what it does. Each of these comments must be on individual lines.
You must receive the option the user wishes to perform into a variable. You will then prompt the user for two numbers on which the specified operation will performed.
If the user enters any option other than what is expected for add, subtract, multiply, or divide they will be notified that they have entered an invalid option.
Your output must include the calculation plus the result.
We've got everything to become your favourite writing service
Money back guarantee
Your money is safe. Even if we fail to satisfy your expectations, you can always request a refund and get your money back.
Confidentiality
We don’t share your private information with anyone. What happens on our website stays on our website.
Our service is legit
We provide you with a sample paper on the topic you need, and this kind of academic assistance is perfectly legitimate.
Get a plagiarism-free paper
We check every paper with our plagiarism-detection software, so you get a unique paper written for your particular purposes.
We can help with urgent tasks
Need a paper tomorrow? We can write it even while you’re sleeping. Place an order now and get your paper in 8 hours.
Pay a fair price
Our prices depend on urgency. If you want a cheap essay, place your order in advance. Our prices start from $11 per page.