Ask Question, Ask an Expert

+61-413 786 465

info@mywordsolution.com

Ask Data Structure Expert

Cr-z-a.te a program that uses a linked list to keep track of the US Presidents.

We have a data the which contains the last name, followed by "other" names ()leach US President, in order. along with the date each took office and the date each left office. By "other" names is meant first or first plus middleks).

Define a struct which has exactly 5 variables that, for one person, will hold the last name, the "other" names. the-year-took-office. the-yew-left-office, and a pointer. The pointer will be used to point to the next set of data. for the next person.

_Arrange r our links so that you have first George Washington, then John Adams. then Thomas Jefferson,etc.

Make sure you terminate the linked list properly.

In your program. read all this data from the file (use a loop) and store it in a linked list. The pointer stored with each President should point to the next President's struct variable.

Then have your program print out these words "The United States Presidents, and the number of years they held office." Move the cursor down to the next line.

Then use the linked-list pointers to step through the list (using a loop) and print out the "other" names (containing whatever spaces they had originally) followed by a space followed by the last name of each person and after the person's name the number of years they were in office (this is a value calculated in your program). So the output has one President per line. Use setw() so that the number-of-years-in¬office are all lined up in a column, right-aligned. For the one still in office print after the name, "Currently in office."

Look at the data file before you start to plan your program. You may test specifically for Van Buren, the only president with a space in his last name, but otherwise do not tailor your program for specific data entries. Make the program general to handle all the data. Do not make any changes in the data tile.

Data Structure, Computer Science

  • Category:- Data Structure
  • Reference No.:- M9896675
  • Price:- $50

Priced at Now at $50, Verified Solution

Have any Question?


Related Questions in Data Structure

Problem regarding the management program

Problem: Looks like its just adding a save and load feature to the same file you sent me for python 3.5 Until now, you have had to leave your team management program running on your computer indefinitely since you did no ...

Data Communication Delivering Information anywhere

Topic: Data Communication Delivering Information anywhere. Write a 9-12 pages paper in which you: Present an overview of the origin and history of the concept. Describe the current use of and attitude toward the concept. ...

  • 4,153,160 Questions Asked
  • 13,132 Experts
  • 2,558,936 Questions Answered

Ask Experts for help!!

Looking for Assignment Help?

Start excelling in your Courses, Get help with Assignment

Write us your full requirement for evaluation and you will receive response within 20 minutes turnaround time.

Ask Now Help with Problems, Get a Best Answer

Why might a bank avoid the use of interest rate swaps even

Why might a bank avoid the use of interest rate swaps, even when the institution is exposed to significant interest rate

Describe the difference between zero coupon bonds and

Describe the difference between zero coupon bonds and coupon bonds. Under what conditions will a coupon bond sell at a p

Compute the present value of an annuity of 880 per year

Compute the present value of an annuity of $ 880 per year for 16 years, given a discount rate of 6 percent per annum. As

Compute the present value of an 1150 payment made in ten

Compute the present value of an $1,150 payment made in ten years when the discount rate is 12 percent. (Do not round int

Compute the present value of an annuity of 699 per year

Compute the present value of an annuity of $ 699 per year for 19 years, given a discount rate of 6 percent per annum. As