//17. Lee la cantidad de horas trabajadas y la tarifa por hora. Calcula el pago;
//   si trabajó más de 40 horas, las extra se pagan al doble.

#include <iostream>
using namespace std;

int main() {
    // Write C++ code here
    std::cout <<"PROGRAMA CALCULA EL VALOR DE SUS HORAS TRABAJAADAS"<<endl;
    float numhoras, valhora, neto, hext, valhext;
    cout<<"ingrese el numero de horas trabajadas "<<endl;
    cin>>numhoras;
    cout<<"ingrese el valor por hora "<<endl;
    cin>>valhora;
    
    if(numhoras>40)
    {
        hext=numhoras-40;
        valhext=hext*(valhora*2);
        neto=(40*valhora)+valhext;
        cout<<"SU VALOR DE HORAS EXTRAS ES "<<" "<<valhext<<endl;
        cout<<"SU VALOR DE HORAS NORMALES ES"<<" "<<40*valhora<<endl;
        cout<<"SU SUELDO NETO ES "<<" "<<neto<<endl;
    }else 
    {
        neto=numhoras*valhora;
        cout<<"SU SUELDO NETO ES "<<" "<<neto<<endl;
    }
    return 0;
}

Embed on website

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