← 返回 stripe 的题目列表Fee Calculation for Transactions
类型:online_judge
Calculate Fees for Different Transaction Types
Given a CSV file containing multiple transactions, each with a fixed fee and a variable fee percentage, write a function to calculate the total fee for each transaction. The fixed and variable fees are provided in the CSV file. You need to process the input and return the fee for each transaction.
Input:
A string in CSV format, each line representing a transaction and including transaction ID, fixed fee, variable fee percentage, and transaction amount.
Output:
A list containing the total fee for each transaction rounded to two decimal places.
Example:
Input:
"1,0.50,0.03,100\n2,0.30,0.02,150"
Output:
[3.50, 3.30]
Constraints:
Transaction amounts are between 0 and 10000.
At most 1000 transactions.
Example
Input
1,0.50,0.03,100\n2,0.30,0.02,150