passage on dowry

#include <stdio.h>

// Function to calculate dowry amount
float calculateDowry(float groomIncome, float brideIncome, int familyStatus) {
    float dowryAmount = 0.0;

    // Determine dowry based on family status
    if (familyStatus == 1) {
        // Upper-class family
        dowryAmount = (groomIncome + brideIncome) * 0.2;
    } else if (familyStatus == 2) {
        // Middle-class family
        dowryAmount = (groomIncome + brideIncome) * 0.1;
    } else {
        // Lower-class family
        dowryAmount = (groomIncome + brideIncome) * 0.05;
    }

    return dowryAmount;
}

int main() {
    // Input variables
    float groomIncome, brideIncome;
    int familyStatus;

    // Prompt user for input
    printf("Enter groom's income: ");
    scanf("%f", &groomIncome);

    printf("Enter bride's income: ");
    scanf("%f", &brideIncome);

    printf("Enter family status (1 for upper-class, 2 for middle-class, 3 for lower-class): ");
    scanf("%d", &familyStatus);

    // Calculate dowry amount using the function
    float dowryAmount = calculateDowry(groomIncome, brideIncome, familyStatus);

    // Display the calculated dowry amount
    printf("Calculated Dowry Amount: $%.2f\n", dowryAmount);

    return 0;
}