// A simplified progressive income tax // calculation // // A jurisdiction charges the following // marginal income tax rates: // // Taxable income Tax rate // First $50 000 10% // Next $50 000 20% // Above $100 000 30% // // Each tax rate applies only to the portion // of income within its corresponding tax // bracket. // // For example, an individual with a taxable // income of $120 000 pays // $50 000 at 10%, so $5 000 // $50 000 at 20%, so $10 000 // $20 000 at 30%, so $6 000 // for a total of $21 000 before any tax // credits are applied. // // First, query the user for an integer age // and assign it to 'age'. If the age is // negative, display // "Invalid age." // and return -1. // // Next, query the user for a nonnegative // integer taxable income and assign it to // 'income'. If the income is negative, // display // "Invalid income." // and return -1. // // Calculate the income tax using the // progressive tax brackets described above // and assign the result to 'tax'. // // Individuals aged 65 or older are eligible // for an age-related tax credit: // // 1. If the taxable income is at most // $75 000, the tax credit is $2 000. // // 2. If the taxable income is greater than // $75 000 but at most $100 000, the // tax credit is $1 000. // // 3. If the taxable income is greater than // $100 000, there is no age-related // tax credit. // // Individuals younger than 65 receive no // age-related tax credit. // // Subtract any applicable tax credit from // the calculated income tax. The final tax // payable cannot be negative. If subtracting // the tax credit would result in a negative // value, set 'tax' to 0. // // Display the final value of 'tax' to the // screen. // // Use conditional statements to calculate // both the progressive income tax and any // applicable age-related tax credit. // Function declarations int main(); // Function definitions int main() { return 0; } // Note: These tax brackets and rates are // fictional and have been simplified for this // exercise. Actual Canadian federal income tax // has more tax brackets and includes deductions, // credits, and other considerations. // // 2026 taxable income Marginal federal rate // First $58,523 14.0% // $58,523.01 to $117,045 20.5% // $117,045.01 to $181,440 26.0% // $181,440.01 to $258,482 29.0% // Above $258,482 33.0% // // For these, it makes more sense to use // a floating-point calculation, rounding // to the nearest integer number of cents.