数据结构代写 |加拿大代写


ECE 250 Algorithms and Data Structures Project 2

咨询 Alpha 小助手,获取更多课业帮助

Do not proceed until you have a working solution for Project 1


Storing a Country’s Data

In the previous project you were able to load a single time series and do some basic analysis.

Although the ability to manipulate a single time series is an important step, the individual time

series do not tell us much in isolation. To that end, it is important to be able to store as much data

about a country as we have available. In this project, you will design and use a data structure that

stores an arbitrary number of time series for a given country. Note: you will not be storing data for

multiple countries simultaneously in this project. That will come later.


Understanding the Dataset

In this project you will be exposed to a file that contains data for multiple countries. The data is in

coma-separated-values format, and we guarantee that no field contains any commas. This means

that you will never encounter a string like “Access to clean fuels, rural”, where the comma would

break your parsing code. Therefore, commas separate only valid fields of data. The columns in the

file are, in order:

Country Name, Country Code, Series Name, Series Code,1960 data, 1961 data,…,2023 data

Country name, Country Code, Series Name, and Series Code are all strings. The data is either

empty, indicated by -1, or floating point data. Here is a sample line (note: due to word wrapping this

is displaying on multiple lines of this document).


Storing Data

The dataset is provided in the file lab2_multidata.csv. In this project we will be providing you

with the dataset and part of the input you will need to parse is the country name. You will need to

read the dataset and load the country’s time series into your new data structure. The number of

time series available for a particular country in the data set is unknown and you may not simply

count them before reading them into a statically allocated array. Do not include it in your final

submission.


Your data structure must store the country name and its code as metadata, then it must be capable

of storing all of the time series available for a given country. Note: there may be time series for a

given country that have no actual data in them. These must still be stored anyway, even though they

will contain no data. Recalling from project 1, this would mean that you are storing the Series Name

and Series Code, then however you deal with missing data is up to you.


By this point in the term you know several data structures that will work. Part of this project is

selecting one that is adequate and implementing it to solve the problem. Therefore, it is possible

that you will have a different design than your colleagues. This is fine with the following caveats:

1. You must use a data structure that you have learned in your programming courses at UW so

far. There are lots of data structures out there that can work for this project, but part of the

point of these projects is that you practice what you are learning. If your project 1 resizable

array is suitably general, you may use it.

2. Your solution must meet the runtime requirements given below.


Program Design and Documentation

You must use proper Object-Oriented design principles to implement your solution. Your class

must have appropriately private data members and appropriately public services (member

functions). It is not acceptable to simply make all data members public and structs are not

permitted.


You must submit a brief design document for this project that outlines your class design.

Guidelines for this document are on Learn.


Input/Output Requirements

In ECE250, we will be testing your submissions via scripts written to run on Linux. To do this your

solution must follow specific formatting requirements.


You must create a test program that contains your main program. This program must read

commands from standard input and write to standard output.


The program must respond to the commands shown in Error! Reference source not found.. The

outputs listed in the “Output” column must appear as shown. For instance, the first row has

“success” as an output. This means that the string “success”, written in lowercase, is expected,

and if more input cases exist the output will continue on the next line. The program ends (and

destructors are called) when standard input is empty.