/**
 * Calculates the Return on Investment (ROI) given the total revenue and total cost.
 *
 * @param totalRevenue The total revenue generated from a marketing campaign.
 * @param totalCost The total cost incurred for the marketing campaign.
 * @return The ROI (Return on Investment) as a percentage.
 * @throws IllegalArgumentException If the totalRevenue or totalCost values are negative.
 */
fun calculateRoi(totalRevenue: Float, totalCost: Float): Float {

    if (totalRevenue < 0 || totalCost < 0) {
        throw IllegalArgumentException("Invalid input. Revenue and cost cannot be negative.")
    }

    val roi = ((totalRevenue - totalCost) / totalCost) * 100
    return roi
}
/**
 * Calculates the Return on Investment (ROI) given the total revenue and total cost.
 *
 * @param totalRevenue The total revenue generated from a marketing campaign.
 * @param totalCost The total cost incurred for the marketing campaign.
 * @return The ROI (Return on Investment) as a percentage.
 * @throws IllegalArgumentException If the totalRevenue or totalCost values are negative.
 */
fun calculateRoi(totalRevenue: Float, totalCost: Float): Float {
/**
 * Calculates the Return on Investment (ROI) given the total revenue and total cost.
 *
 * @param totalRevenue The total revenue generated from a marketing campaign.
 * @param totalCost The total cost incurred for the marketing campaign.
 * @return The ROI (Return on Investment) as a percentage.
 * @throws IllegalArgumentException If the totalRevenue or totalCost values are negative.
 */
fun calculateRoi(totalRevenue: Float, totalCost: Float): Float {

    if (totalRevenue < 0 || totalCost < 0) {
        throw IllegalArgumentException("Invalid input. Revenue and cost cannot be negative.")
    }

    val roi = ((totalRevenue - totalCost) / totalCost) * 100
    return roi
}