tax method

double tax(
  1. double percent
)

Applies a tax percentage to this number (adds percentage).

Example:

double price = 100.0;
double result = price.tax(10); // 110.0 (100 + 10%)

Implementation

double tax(double percent) => this * (1 + percent / 100);