Computer Science, asked by samiksha7947, 1 year ago

Using arrays write a program that receives tax rate, work hours and wage per hour for two persons, saves work hours of those persons in an array and then calculates and prints payable money for each of them.

Answers

Answered by zoekar26
0

Answer:

I wrote it in C. Hope it helps

Explanation:

#include <stdio.h>

#include <stdlib.h>

#define  N 2

main() {

float tax_rate, payable_money[N];

int work_hours[N], wage, i;

printf("Give the tax rate: ");

scanf("%f" &tax_rate);

printf("Give the wage per hour: ");  /*saying that the get paid the same*/

scanf("%d", &wage);

for(i=0; i<N; i++){

printf("Give the work hours for the %d person: ", i);

scanf("%d", &work_hours[i]);

payable_money[i] = work_hours[i] * wage *(tax_rate/100)

}

for(i=0;i<N; i++){

printf("The payable money for the %d person is %f\n", i, payable_money[i]);

}

system("pause");

}

Similar questions