Code Monkey home page Code Monkey logo

practice_collaboration's Issues

Make 4 remote feature branches

Remote feature branches for add, sub, mul, and div respectively.
Two people will work together on a single feature branch; one implements and another makes test cases.

Add subtract method "sub" in the class "Calculator"

  1. implement an sub method
    the method receives two float inputs and output is subtraction result of first input to second input as float

  2. implement a test for sub method
    test will be done on the implemented script

Example)

calc=Calculator()
#two float inputs
a=2.0
b=2.0

assert calc.sub(a,b) == 0.0

>>> Passed

Make mul function

We will make a mul function

#input can be any real number
x = 2.0 # real number
y = 1.1 # real number

#body will multiply this two of values.
x * y = 2.2 # output : real number

test code

assert calc.mul(x, y) == 2.2

we will test ten of gugudan examples

Add subtract method "sub" in the class "Calculator"

Make subtract function for calculator.
Takes two float input and returns float output result of subtraction of first input to second input.
Implement 'sub()' in class Calculator, 'calculator.py'.
Test will be in 'test_calculator.py'

like

cal=Calculator()
float result = cal.sub(float a, float b)  

example:

cal = Calculator()
result =cal.sub(2,2)
assert result ==0 

it will pass the test

Add divide function "div" in calculator

In calculator.py, implement 'div()', a divide function. This function is given two numbers float type a, b and returns float type a/b. Test will be in 'test_calculator.py'

example

cal = Calculator()
result = cal.div(4.2, 2.1)
assert result == 2.

This test will pass.

cal = Calculator()
result = cal.div(4.2, 2.1)
assert result == 3.

This test will fail.

Push base files before starting SimpleCalc project

The base files will be working as simple guidance for future collaboration.

1. calculator.py

  • includes Calculator abstract class (without any implementation).

2. test_calculator.py

  • includes TestCalculator abstract class (with the only declaration of test cases).

Make add method in the class `Calculator`

  1. implement an add method
    the method receives two real-valued inputs and outputs a sum of the two

  2. implement a test for add method
    test will be done on the implemented script

Example)

calc = Calculator()
# input can be any real number
x = 1.0
y = 1.0

assert calc.add(x, y) == 2.0
print ("Passed")

>>> Passed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.