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!
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!
Trending now
This is a popular solution!
Step by step
Solved in 4 steps with 5 images