Untitled

mail@pastecode.io avatar
unknown
c_cpp
7 months ago
384 B
0
Indexable
Never
#include <iostream>

void computePaycheck(int data[2]) {
    int hoursWorked = data[0];
    double hourlyWage = data[1];

    double totalPay = hoursWorked * hourlyWage;

    std::cout << "Total paycheck: $" << totalPay << std::endl;
}

int main() {
    // Example usage
    int workData[] = {2, 20}; // 2 hours worked, $20 hourly wage

    computePaycheck(workData);

    return 0;
}
Leave a Comment