def test_addition(self):
     """
     testing addition
     :return:
     """
     self.assertEqual(Standardmathemeticaloperations(5, 10).addition(), 15)
     self.assertEqual(Standardmathemeticaloperations(5, -1).addition(), 4)
     self.assertEqual(Standardmathemeticaloperations(-5, -1).addition(), -6)
 def test_division(self):
     """
     testing division
     :return:
     """
     self.assertEqual(Standardmathemeticaloperations(10, 5).division(), 2)
     self.assertEqual(Standardmathemeticaloperations(5, -1).division(), -5)
     self.assertEqual(Standardmathemeticaloperations(-5, -1).division(), 5)
 def test_substraction(self):
     """
     testing substraction
     :return:
     """
     self.assertEqual(
         Standardmathemeticaloperations(10, 5).substraction(), 5)
     self.assertEqual(
         Standardmathemeticaloperations(5, -1).substraction(), 6)
     self.assertEqual(
         Standardmathemeticaloperations(-5, -1).substraction(), -4)
 def test_multiplication(self):
     """
     testing multiplication
     :return:
     """
     self.assertEqual(
         Standardmathemeticaloperations(5, 10).multiplication(), 50)
     self.assertEqual(
         Standardmathemeticaloperations(5, -1).multiplication(), -5)
     self.assertEqual(
         Standardmathemeticaloperations(-5, -1).multiplication(), 5)
Exemple #5
0
 def triangle_area(self):
     """
     finding the area of the triangle
     :return:
     """
     res_add = Standardmathemeticaloperations(self.length,
                                              self.width).addition()
     s = Standardmathemeticaloperations(res_add, self.height).addition() / 2
     area_triangle = (s * (s - self.length) * (s - self.width) *
                      (self.height))**0.5
     print("Area of the triangle :", area_triangle)
     return area_triangle
 def square(self):
     """
     finding  square of number
     :return:
     """
     result_square = Standardmathemeticaloperations(self.a, self.b).multiplication()
     # print("result_square :", result_square)
     return result_square
 def cube(self):
     """
     finding qube of number
     :return:
     """
     result = Standardmathemeticaloperations(self.a, self.b).multiplication()
     result_cube = result * self.a
     # print("Cube :", result_cube)
     return result_cube
Exemple #8
0
 def square_area(self):
     """
     finding the area of the square
     :return:
     """
     area_sqaure = Standardmathemeticaloperations(
         self.length, self.width).multiplication()
     print("Area of the square :", area_sqaure)
     return area_sqaure
Exemple #9
0
"""
from Area_calculations.Area import Differentareacalaculations
from mathoperations.advanced import Advancedmathemeticaloperations
from mathoperations.standard import Standardmathemeticaloperations


class calling():
    pass


a = int(input("Enter first number :"))
b = int(input("Enter second number :"))
length = int(input("Enter length :"))
width = int(input("Enter width :"))
height = int(input("Enter height :"))
AREA_OBJ = Differentareacalaculations(length, width, height)
STANDARD_OBJ = Standardmathemeticaloperations(a, b)
ADVANCED_OBJ = Advancedmathemeticaloperations(a, b)
RESULT_SUB = STANDARD_OBJ.substraction()
RESULT_ADD = STANDARD_OBJ.addition()
RESULT_DIV = STANDARD_OBJ.division()
RESULT_MUL = STANDARD_OBJ.multiplication()
RESULT_SQUARE = ADVANCED_OBJ.square()
RESULT_CUBE = ADVANCED_OBJ.cube()
RESULT_SUAREROOT = ADVANCED_OBJ.squareroot()
RESULT_CUBEROOT = ADVANCED_OBJ.cuberoot()
RESULT_SQUARE_AREA = AREA_OBJ.square_area()
RESULT_RECTANGLE_AREA = AREA_OBJ.rectangle_area()
RESULT_TRIANGLE_AREA = AREA_OBJ.triangle_area()
RESULT_HEXAGON_AREA = AREA_OBJ.hexagon_area()