SophiaPretty

(5)

$14/per page/Negotiable

About SophiaPretty

Levels Tought:
Elementary,Middle School,High School,College,University,PHD

Expertise:
Accounting,Algebra See all
Accounting,Algebra,Applied Sciences,Architecture and Design,Art & Design,Biology,Business & Finance,Calculus,Chemistry,Communications,Computer Science,Economics,Engineering,English,Environmental science,Essay writing Hide all
Teaching Since: Jul 2017
Last Sign in: 304 Weeks Ago, 1 Day Ago
Questions Answered: 15833
Tutorials Posted: 15827

Education

  • MBA,PHD, Juris Doctor
    Strayer,Devery,Harvard University
    Mar-1995 - Mar-2002

Experience

  • Manager Planning
    WalMart
    Mar-2001 - Feb-2009

Category > Computer Science Posted 11 Dec 2017 My Price 7.00

which implements a simple calculator using python.

Write a program (Python script) named mycalc.py, which implements a simple calculator using python. As you approach this assignment try to visualize how you would use a calculator. Typically you would enter a number into the calculator, next you would select an operation to perform (add, subtract, multiply, divide), next you would enter a second number, finally you would press the equals sign to begin the calculation. The following examples illustrate both a flowchart and the pseudo code that outlines how to solve the calculator problem. They provide a conceptual model (a conceptual model is something that attempts to describe how something works) of the calculator, define how the program must flow from one task or statement to the next, and describes the functionality that the program will provide.

 

You should submit a script file (.py or .txt) and an output file (.doc or .pdf). Don’t forget to use comments and readable variable names.

 

Pseudo Code for Python Calculator

 

Prompt for first number

Read first number and store in variable

Display operations (1-add, 2-subtract, 3-multiply, 4-divide)

Prompt for operation

Read operation and store in variable

Prompt for second number

Read second number and store in variable

If operation is equal to 1 (add)

  Then

      Add first number to second number and store result in variable

Otherwise if operation is equal to 2 (subtract)

  Then

      Subtract second number from first number and store result in a variable

Otherwise if operation is equal to 3 (multiply)

  Then

     Multiply first number with second number and store result in a variable Other wise if operation is equal to 4 (divide)

  Then

     Divide first number by the second number and store result in a variable

Otherwise exit program

  Display the result stored in the variable

Exit the program

 

Flowchart for Python Calculator

Answers

(5)
Status NEW Posted 11 Dec 2017 12:12 PM My Price 7.00

-----------  ----------- H-----------ell-----------o S-----------ir/-----------Mad-----------am ----------- Th-----------ank----------- yo-----------u f-----------or -----------you-----------r i-----------nte-----------res-----------t a-----------nd -----------buy-----------ing----------- my----------- po-----------ste-----------d s-----------olu-----------tio-----------n. -----------Ple-----------ase----------- pi-----------ng -----------me -----------on -----------cha-----------t I----------- am----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I w-----------ill----------- be----------- qu-----------ick-----------ly

Not Rated(0)