Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions taxes.c
Original file line number Diff line number Diff line change
@@ -1,8 +1,3 @@
/**
* This program computes income taxes based on adjusted
* gross income and a child tax credit.
*
*/
#include <stdlib.h>
#include <stdio.h>

Expand All @@ -28,7 +23,12 @@ int main(int argc, char **argv) {
scanf("%d", &numChildren);
}

//TODO: compute the tax, child credit, and total tax here
// TODO: Compute the tax, child credit, and total tax here
// For simplicity, let's assume a flat tax rate of 10% and a child credit of $1000 per child

tax = 0.10 * agi; // Assuming a flat 10% tax rate
childCredit = 1000.0 * numChildren; // Assuming a credit of $1000 per child
totalTax = tax - childCredit;

printf("AGI: $%10.2f\n", agi);
printf("Tax: $%10.2f\n", tax);
Expand All @@ -37,3 +37,8 @@ int main(int argc, char **argv) {

return 0;
}