1. Write a program in C/C++ that reads a table of data from an input file and displays the data. The program then prompts the user to see the data in specific order. The output of your program should display the sorted data (descending order) according to the user selection. Your program should display the prompt repeatedly until the user wants to exit. See the test run. The input file contains four data fields: Country, Total cases, New cases, and Total deaths. The number of rows (data) can vary between 5 to 100. You must use Quick sort in your implementation. Example test run: Country Total Cases New Cases Total Deaths USA 48072665 70590 784775 India 34447536 10560 463655 Brazil 21960766 2799 611384 UK 9600369 39705 143945 Russia 9109094 38420 256587 Turkey 8432018 23885 73745 France 7300887 3241 118224 Iran 6045212 7493 128272 Argentia 5307160 1417 116250 Germany 5100910 30487 98623 Spain 5056267 3266 87761 Display the data in the following format: Total Cases New Cases Total Deaths 4. Exit User choice: 3 Country Total Cases New Cases Total Deaths USA 48072665 70590 784775 Brazil 21960766 2799 611384 India 34447536 10560 463655 Russia 9109904 38420 256587 UK 9600369 39705 143945 Iran 6045212 7493 128272 France 7300887 3241 118224 Argentia 5307160 1417 116250 Germany 5100910 30487 98623 Spain 5056267 3266 87761 Turkey 8432018 23885 73745 Display the data in the following format: Total Cases New Cases Total Deaths Exit User choice: 2 Country Total Cases New Cases Total Deaths USA 48072665 70590 784775 UK 9600369 39705 143945 Russia 9109904 38420 256587 Germany 5100910 30487 98623 Turkey 8432018 23885 73745 India 34447536 10560 463655 Iran 6045212 7493 128272 Spain 5056267 3266 87761 France 7300887 3241 118224 Brazil 21960766 2799 611384 Argentia 5307160 1417 116250 Display the data in the following format: Total Cases New Cases Total Deaths Exit User choice: 4 Stay healthy, stay safe! Bye!

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

1. Write a program in C/C++ that reads a table of data from an input file and displays the data. The program then prompts the user to see the data in specific order. The output of your program should display the sorted data (descending order) according to the user selection. Your program should display the prompt repeatedly until the user wants to exit. See the test run.

The input file contains four data fields: Country, Total cases, New cases, and Total deaths. The number of rows (data) can vary between 5 to 100. You must use Quick sort in your implementation.

Example test run:

Country               Total Cases               New Cases                  Total Deaths        

USA                       48072665                      70590                           784775

India                      34447536                      10560                           463655

Brazil                     21960766                        2799                            611384

UK                          9600369                       39705                           143945

Russia                    9109094                       38420                           256587

Turkey                    8432018                       23885                             73745

France                   7300887                          3241                            118224

Iran                        6045212                          7493                            128272

Argentia                5307160                          1417                             116250

Germany               5100910                       30487                             98623

Spain                    5056267                         3266                              87761

 

Display the data in the following format:

  1. Total Cases

  2. New Cases

  3. Total Deaths

4. Exit

User choice: 3

Country               Total Cases               New Cases                  Total Deaths        

USA                       48072665                      70590                           784775

Brazil                     21960766                        2799                            611384

India                     34447536                      10560                            463655

Russia                    9109904                       38420                           256587

UK                         9600369                        39705                           143945

Iran                        6045212                          7493                            128272

France                   7300887                          3241                            118224

Argentia                5307160                          1417                             116250

Germany               5100910                       30487                             98623

Spain                    5056267                         3266                              87761

Turkey                    8432018                       23885                             73745

Display the data in the following format:

  1. Total Cases

  2. New Cases

  3. Total Deaths

  4. Exit

User choice: 2

Country               Total Cases               New Cases                  Total Deaths        

USA                       48072665                      70590                           784775

UK                         9600369                        39705                           143945

Russia                    9109904                       38420                           256587

Germany               5100910                       30487                             98623

Turkey                    8432018                       23885                             73745

India                     34447536                      10560                            463655

Iran                        6045212                          7493                            128272

Spain                    5056267                          3266                              87761

France                   7300887                         3241                             118224

Brazil                     21960766                        2799                            611384

Argentia                5307160                          1417                             116250

Display the data in the following format:

  1. Total Cases

  2. New Cases

  3. Total Deaths

  4. Exit

User choice: 4
Stay healthy, stay safe! Bye!

Expert Solution
trending now

Trending now

This is a popular solution!

steps

Step by step

Solved in 4 steps with 5 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY