|
|
|
|
4
|
![main2.png](images/main2.png)
|
4
|
![main2.png](images/main2.png)
|
5
|
![main3.png](images/main3.png)
|
5
|
![main3.png](images/main3.png)
|
6
|
|
6
|
|
|
|
7
|
+[Verano 2016 - Ive]
|
7
|
|
8
|
|
8
|
Arrays help us to store and work with groups of data of the same type. The data is stored in consecutive memory spaces which can be accessed by using the name of the array and indexes or subscripts that indicate the position where the data is stored. Repetition structures provide us a simple way of accessing the data within an array. In today's laboratory experience you will practice the use of counters and one dimensional arrays to implement a program in which you will use Benford’s Law to detect files with bogus data.
|
9
|
Arrays help us to store and work with groups of data of the same type. The data is stored in consecutive memory spaces which can be accessed by using the name of the array and indexes or subscripts that indicate the position where the data is stored. Repetition structures provide us a simple way of accessing the data within an array. In today's laboratory experience you will practice the use of counters and one dimensional arrays to implement a program in which you will use Benford’s Law to detect files with bogus data.
|
9
|
|
10
|
|
|
|
|
|
138
|
|
139
|
|
139
|
1. Load the project `BenfordsLaw` into `QtCreator`. There are two ways to do this:
|
140
|
1. Load the project `BenfordsLaw` into `QtCreator`. There are two ways to do this:
|
140
|
|
141
|
|
141
|
- a. Using the virtual machine: Double click the file `BenfordsLaw`.pro` located in the folder `/home/eip/labs/arrays-benfordslaw` of your virtual machine.
|
|
|
142
|
-
|
|
|
143
|
- b. Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/arrays-benfordslaw` to download the folder `arrays-benfordslaw` from `Bitbucket`. Double click the file `BenfordsLaw.pro` located in the folder that you downloaded to your computer.
|
|
|
|
|
142
|
+ * Using the virtual machine: Double click the file `BenfordsLaw`.pro` located in the folder `/home/eip/labs/arrays-benfordslaw` of your virtual machine.
|
|
|
143
|
+
|
|
|
144
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/arrays-benfordslaw` to download the folder `arrays-benfordslaw` from `Bitbucket`. Double click the file `BenfordsLaw.pro` located in the folder that you downloaded to your computer.
|
144
|
|
145
|
|
145
|
2. The text files `cta-a.txt`, `cta-b.txt`, `cta-c.txt`, `cta-d.txt`, and `cta-e.txt` in the `data` directory contain either real or bogus data. Each line of the file specifies the bus route code and the number of users for that route on a certain day. Open the file `cta-a.txt` to understand the data format. This will be important when reading the file sequentially using C++. Notice that some of the route codes contain characters.
|
146
|
2. The text files `cta-a.txt`, `cta-b.txt`, `cta-c.txt`, `cta-d.txt`, and `cta-e.txt` in the `data` directory contain either real or bogus data. Each line of the file specifies the bus route code and the number of users for that route on a certain day. Open the file `cta-a.txt` to understand the data format. This will be important when reading the file sequentially using C++. Notice that some of the route codes contain characters.
|
146
|
|
147
|
|