Question: Can someone help on how to code this for C/C++? Instructor note: NOTE You should not be adding any library functions to the starter code.



Can someone help on how to code this for C/C++?
Instructor note: NOTE You should not be adding any library functions to the starter code. The addition of some library functions will result in no credit Using library functions outside of those provided in the starter code could result in you solving the problem using concepts that are not intended to be practiced on this assignment. In many cases, using library functions can significantly change the difficulty of the assignment. Do NOT use any libraries other than what is provided in the starter code to avoid deductions in your score and to best prepare yourself in this class Using the same data from Project 5, you will reimplement your code using vectors. Here is the sample output you should produce from watertxt input file (note there are some changes, no mean and no #s. WATER RESOURCES DATA: Kuwait 17820 3.892e+06 0.02 SaudiArabia 2.14969e+06 3.154e+07 2.4 Kenya 580370 4.605e+07 307 Ethiopia 1.1043e+06 9.9391e+07 122 India 3.28726e+06 1.31105e+09 1911 Nigeria 923770 1.82202e+08 286.2 Germany 357170 8.06890+07 154 China 9.69+06 1.40731e+09 2840 Ghana 238540 2.741e+07 56.2 Italy 301340 5.9798e+07 191.3 Japan 377960 1.26573e+08 430 Mali 1.24019e+06 1.76e+07 120 USA 9.83151e+06 3.21774e+08 3069 RussianFederation 1.70982e+07 1.43457e+08 4525 Brazil 8.51577e+06 2.07848e+08 8647 Peru 1.28522e+06 3.1377e+07 1880 Canada 9.98467e+06 3.594e+07 2902 Total number of countries: 18 Countries with less than 1000 m 3/inhab/year: Kuwait SaudiArabia Kenya Countries with greater than 6.5% of water resources: USA RussianFederation Brazil RULES 1. You have 10 submissions to test your code. Use the debug mode to test before submitting your code for autograding, because you only have 10 submissions to check (in develop mode, you can do unlimited tests, in submit mode, you can only submit 10 times)! Don't forget to do some error handling. If the user enters a file name that does not exist (or is not accessible in the current folder),you should not attempt to read from that file by exiting the program immediately and providing some error output Error: unable to open file! 3. You are only allowed to read the file ONE time. If you read the file multiple times, you will not get full credit for the assignment 4 You must use vectors to solve this problem. Do not use arrays, we will not be using arrays in this course and they should never be used on any assignment or exam. 5. Your goal is to loop through the number of total countries as few times as possible. It is possible to loop through the total number of 5. Your goal is to loop through the number of total countries as few times as possible. It is possible to loop through the total number of countries on one time (while reading the file). When I solved this problem, I found that implementation clunky, so my solution loops through the total number of countries only twice (once while file reading and one other tirie). Try to see if you can find the cleanest, most readable solution, that also minimizes looping through the total number of countries. 6. Do NOT add any libraries beyond what is included in the starter code. ACTITY 39 1: Project 6-Reading Water Resources Data with Vectors Additional files provided by your instructor LAB 0/100 water.txt ad waterBig.txtDownload project6.cpp Load default template... 1 uinclude
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
