Question
ULO 3: Describe and discuss the elements of effective programming style
ULO 4: Demonstrate an understanding of the software development life cycle and apply sound programming analysis techniques (design, coding, debugging, testing and documentation) to justify simple programming problems

In this project, you will work individually to write programs which demonstrate your understanding of IPO and usage of simple functions in Python programs.
Content and Structure:
You will have to write a modular program to:
1. Perform a series of transactions
2. This will be a project which students will choose and discuss with the lecturer prior to commencing.
3. Examples could be a scientific calculator, expense management system, online shopping system, banking system etc.
Solution Preview

These solutions may offer step-by-step problem-solving explanations or good writing examples that include modern styles of formatting and construction of bibliographies out of text citations and references.
Students may use these solutions for personal skill-building and practice.
Unethical use is strictly forbidden.

'''
Python Scientific Calculator
calculator.py
'''

import math

# Utils class
class Utils:

    # Method to get n values
    def getValues(n):
       values = []
       while len(values) < n:
            try:
                value = float(input("Enter value #" + str(len(values)+1) + ": "))
                if value == int(value):
                   value = int(value)
                values.append(value)
            except:
                print("Error: Please enter valid numeric input")
       return values

# Operation abstract class
class Operation:

    # Constructor
    def __init__(self):
       self.name = type(self).__name__

    # Get String representation
    def __str__(self):
       return self.name

    # Get String representation
    def __repr__(self):
       return self.name

    # Method to apply operation
    def apply(self):
       print("")
       print("Operation: " + self.name)

# Addition Operation
class Addition(Operation):

    # Apply Addition on 2 values
    def apply(self):
       super().apply()
       values = Utils.getValues(2)
       result = values[0] + values[1]
       print(str(values[0]) + " + " + str(values[1]) + " = " + str(result))

# Subtraction Operation
class Subtraction(Operation):

    # Apply Subtraction on 2 values
    def apply(self):
       super().apply()
       values = Utils.getValues(2)
       result = values[0] - values[1]
       print(str(values[0]) + " - " + str(values[1]) + " = " + str(result))

# Multiplication Operation
class Multiplication(Operation):

    # Apply Multiplication on 2 values
    def apply(self):
       super().apply()
       values = Utils.getValues(2)
       result = values[0] * values[1]
       print(str(values[0]) + " * " + str(values[1]) + " = " + str(result))

# Division Operation
class Division(Operation):

    # Apply Division on 2 values
    def apply(self):
       super().apply()
       values = Utils.getValues(2)
       if values[1] == 0:
            print("Error: Divide by zero!")
       else:
            result = values[0] / values[1]
            print(str(values[0]) + " / " + str(values[1]) + " = " + str(result))

# Remainder Operation
class Remainder(Operation):

    # Apply Remainder on 2 values
    def apply(self):
       super().apply
This is only a preview of the solution.
Please use the purchase button to see the entire solution.
By purchasing this solution you'll be able to access the following files:
Solution.PNG
Solution.py
Purchase Solution
$60.00
Google Pay
Amazon
Paypal
Mastercard
Visacard
Discover
Amex
View Available Computer Science Tutors 645 tutors matched
Ionut
(ionut)
Master of Computer Science
Hi! MSc Applied Informatics & Computer Science Engineer. Practical experience in many CS & IT branches.Research work & homework
5/5 (6,805+ sessions)
1 hour avg response
$15-$50 hourly rate
Pranay
(math1983)
Doctor of Philosophy (PhD)
Ph.D. in mathematics and working as an Assistant Professor in University. I can provide help in mathematics, statistics and allied areas.
4.6/5 (6,694+ sessions)
1 hour avg response
$40-$50 hourly rate
Leo
(Leo)
Doctor of Philosophy (PhD)
Hi! I have been a professor in New York and taught in a math department and in an applied math department.
4.9/5 (6,462+ sessions)
2 hours avg response

Similar Homework Solutions