Columbus State Community College Math Calculator Exercise Assignment: Lab Exercise 6 Python: Math Calculator Python Assignment The objectives of this la | Course Hero

Columbus State Community College Math Calculator Exercise Assignment: Lab Exercise 6

Python: Math Calculator

Don't use plagiarized sources. Get Your Custom Essay on
Columbus State Community College Math Calculator Exercise Assignment: Lab Exercise 6 Python: Math Calculator Python Assignment The objectives of this la | Course Hero
This is a Snippet Preview, get a Complete Solution Here
Order Essay

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.

superadmin

Recent Posts