#include <iostream>

int main() {
    float num1, num2, num3;
    float w1, w2, w3;
    float w_sum, total_w, w_division;

    std::cout << "Ingrese el primer número: ";
    std::cin >> num1;
    std::cout << "Ingrese el peso para el primer número: ";
    std::cin >> w1;

    std::cout << "Ingrese el segundo número: ";
    std::cin >> num2;
    std::cout << "Ingrese el peso para el segundo número: ";
    std::cin >> w2;

    std::cout << "Ingrese el tercer número: ";
    std::cin >> num3;
    std::cout << "Ingrese el peso para el tercer número: ";
    std::cin >> w3;

    w_sum = (num1 * w1) + (num2 * w2) + (num3 * w3);
    total_w = w1 + w2 + w3;
    w_division = w_sum / total_w;

    std::cout << "El promedio ponderado es: " << w_division << std::endl;

    return 0;
}

    
    

Embed on website

To embed this program on your website, copy the following code and paste it into your website's HTML: