Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Download the attached file/s, copy and paste the code segment/s into your visual studio or any other C++ IDE and run it. You will have

Download the attached file/s, copy and paste the code segment/s into your visual studio or any other C++ IDE and run it. You will have to implement a small intentional bug in your program and post it.

this is the code i was given.

// This program demonstrates how to use an array of strucures #include  #include  using namespace std; struct taxPayer { float taxRate; float income; float taxes; }; int main() { taxPayer citizen[5]; cout << fixed << showpoint << setprecision(2); cout << "Please enter the annual income and tax rate for 5 tax payers: " << endl; cout << endl << endl; for (int count = 0; count < 5; count++) { cout << "Enter this year's income for tax payer " << (count + 1) << ": "; cin >> citizen[count].income; cout << "Enter the tax rate for tax payer # " << (count + 1) << ": "; cin >> citizen[count].taxRate; cout << endl; citizen[count].taxes = citizen[count].income * citizen[count].taxRate; } cout << "Taxes due for this year: " << endl << endl; for (int index = 0; index < 5; index++) { cout << "Tax Payer # " << (index + 1) << ": " << "$ " << citizen[index].taxes << endl; } return 0; }

I would like the code to build successfully without any errors. So, I guess I would like the bug to be "hidden" in a way.

Thank you in advance.

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Beginning ASP.NET 4.5 Databases

Authors: Sandeep Chanda, Damien Foggon

3rd Edition

1430243805, 978-1430243809

More Books

Students also viewed these Databases questions

Question

Determine the following indefinite integrals. dx xV4 .8

Answered: 1 week ago

Question

5. Who should facilitate the focus group?

Answered: 1 week ago