Question

Part 1 Fill in the code below as indicated by the comments in bold // PLACE YOUR NAME HERE // This program demonstrates how t

cout << Enter this years income for tax payer ; cout << (count + 1) << : ; // Fill in code to read in the income to the

0 0
Add a comment Improve this question Transcribed image text
Answer #1

PLEASE NOTE : FEEL FREE TO ASK ANY DOUBTS by COMMENTING

  • Please check spelling for output statements.
  • If you want me to add/change anythin, Please let me know by commenting.
  • Comments starts with ' // '
  • Please refer to the screenshot of the code to understand the indentation of the code

Language : C++ Programming

IDE : Dev C++

:::::::::::::::::::::::::::::::::::::::::::: CODE ::::::::::::::::::::::::::::::::::::::::

// PLACE YOUR NAME HERE
// This program demonstrates how to use an array of structures
#include <iostream>
#include <iomanip>
using namespace std;

// Fill in code to declare a structure called taxPlayer that has three
// members: taxRate, income, and taxes - each of type float
struct taxPlayer{
   float taxRate, income, taxes;
};

int main(){

   // Fill in code to define an array named citizen which holds
   // 5 taxPlayers structures
   struct taxPlayer citizen[5];

   cout << "Please enter the annual income and tax rate for 5 tax payers: ";
   cout << endl << endl << endl;

   for(int count = 0; count<5; ++count){

       cout << "Enter this year's income for tax payer ";
       cout << (count+1) << ": ";

       // Fill in code to read in the income to the appropriate place
       cin >> citizen[count].income;

       cout << "Enter the tax rate for tax payer # " << (count+1);
       cout << ": ";

       // Fill in code to read in the tax rate to the appropriate place
       cin >> citizen[count].taxRate;

       // Fill in code to compute and store the taxes for the citizen
       citizen[count].taxes = (citizen[count].taxRate/100)*citizen[count].income;

   }

   cout << fixed << showpoint << setprecision(2);
   cout << "Taxes due for this year: " << endl << endl;

   // The output of all the data is shown here
   // Fill in code for the first line of a loop that will output the
   // tax information

   for(int index = 0; index<5; ++index){

       cout << "Tax Payer # " << (index+1) << ": ";
       cout << "$ " << citizen[index].taxes << endl;

   }

   system("PAUSE");
   return 0;
}

:::::::::::::::::::::::::::::::::::::::::::: OUTPUT ::::::::::::::::::::::::::::::::::::::::

C:\Users\PREMKUMAR\Documents July\tax Payer.exe Please enter the annual income and tax rate for 5 tax payers: Enter this year

:::::::::::::::::::::::::::::::::::::: CODE in EDITOR ::::::::::::::::::::::::::::::::::

9 tax Payer.cpp PLACE YOUR NAME HERE Il This program demonstrates how to use an array of structures #include <iostream> #incl

_________________________________________________________________

Dear Friend, Feel Free to Ask Any Doubts by Commenting. ASAP i'll respond when i'm available.

I'm on a critical Situation. Please Do Not Forget To Give A Thumbs UP +1. It will Helps me A Lot.

Thank YOU :-)

Add a comment
Know the answer?
Add Answer to:
Part 1 Fill in the code below as indicated by the comments in bold // PLACE...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • I Need Help. I MUST USED VECTOR OF STRUCTUERS INSTEAD OF AN ARRAY. HOW CAN MAKE...

    I Need Help. I MUST USED VECTOR OF STRUCTUERS INSTEAD OF AN ARRAY. HOW CAN MAKE THIS INTO VECTOR STRUCTUERS? #include #include using namespace std; // This program demonstrates how to use an array of structures// PLACE YOUR NAME HERE // Fill in code to define a structure called taxPayer that has three// members: taxRate, income, and taxes -- each of type float int main(){   // Fill in code to declare an array named citizen which holds   // 5 taxPayers structures cout...

  • Create a C++ project called lab3b and add the following source code init_struct.cpp to the project....

    Create a C++ project called lab3b and add the following source code init_struct.cpp to the project. #include <iostream> #include <string> #include <iomanip> using namespace std; // This program demonstrates partially initialized structure variables // PLACE YOUR NAME HERE struct taxPayer {        string name;        long socialSecNum;        float taxRate; float income; float taxes; }; int main() {        // Fill in code to initialize a structure variable named citizen1 so that        // the first three members are initialized....

  • Create a C++ Console project called Lab3a and add the following source document rect_struct.cpp to the...

    Create a C++ Console project called Lab3a and add the following source document rect_struct.cpp to the project. #include <iostream> #include <iomanip> using namespace std; // This program uses a structure to hold data about a rectangle // PLACE YOUR NAME HERE // Fill in code to declare a structure named rectangle which has // members length, width, area, and perimeter all of which are floats int main() {        // Fill in code to define a rectangle variable named box...

  • Using the code below (C++), add a struct with only 1 vector #include #include #include //...

    Using the code below (C++), add a struct with only 1 vector #include #include #include // Needed to define vectors using namespace std; int main() { vector hours; // hours is an empty vector vector payRate; // payRate is an empty vector int numEmployees; // The number of employees int index; // Loop counter // Get the number of employees. cout << "How many employees do you have? "; cin >> numEmployees; // Input the payroll data. cout << "Enter...

  • // PLACE YOUR NAME HERE #include <iostream> using namespace std; float findAverage (int [], int); //...

    // PLACE YOUR NAME HERE #include <iostream> using namespace std; float findAverage (int [], int); // finds average of all //grades int findHighest (int [], int); // finds highest of all //grades int findFirstFail( int[]); int main() { int grades[100]; // the array holding 100 grades. int numberOfGrades; // the number of grades read. int pos; // index to the array. float avgOfGrades; // contains the average of the grades. int highestGrade; // contains the highest grade. int inderOfFail; //...

  • I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7:...

    I need help with this code. I'm using C++ and Myprogramming lab to execute it. 11.7: Customer Accounts Write a program that uses a structure to store the following data about a customer account:      Customer name      Customer address      City      State      ZIP code      Telephone      Account balance      Date of last payment The program should use an array of at least 20 structures. It should let the user enter data into the array, change the contents of any element, and display all the...

  • c++, we have to write functions for the code given below and other instructions for it...

    c++, we have to write functions for the code given below and other instructions for it to compile. I am having issues understanding how to confront the problem and how to write functions and read the program so it can eventually be solved so it can be compiled 7/ * INSTRUCTIONS: Write two functions in the space // * indicated below. // * // * #1 => Find index of maximum value: Write a function that will // * find...

  • C++ Project Modify the Date Class: Standards Your program must start with comments giving your name...

    C++ Project Modify the Date Class: Standards Your program must start with comments giving your name and the name of the assignment. Your program must use good variable names. All input must have a good prompt so that the user knows what to enter. All output must clearly describe what is output. Using the date class, make the following modifications: Make the thanksgiving function you wrote for project 1 into a method of the Date class. It receive the current...

  • Need C++ Code (Please put //comments on there too) 1. Complete the following code: Design a...

    Need C++ Code (Please put //comments on there too) 1. Complete the following code: Design a class called Circle. The class should have an integer member variable named radius and three member functions; setRadius, getRadius, calArea; the functions' prototypes should be done inside the class declaration and the functions' definitions should come after the main function #include <iostream> using namespace std; const double PI = 3.14; // fill in the declaration of the class Circle here int main() { Circle...

  • Write an application that does the following: (1) fill a 32-bit array with 10 pseudo-random integers...

    Write an application that does the following: (1) fill a 32-bit array with 10 pseudo-random integers between -50 and +49 ; (2) Loop through the array, displaying each value, and count the number of negative values; (3) After the loop finishes, display the count. Below is an assembly program template that you can refer, and complete the programming by filling in the codes into the specified place: Comment ! Title: Counting Array Values Description: Write an application that does the...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT