|
|
|
|
9
|
|
9
|
|
10
|
During this semester the students in the Introduction to Computer Programming course will be participating in the project: "Engaging Introductory Programming Laboratory" (EIP). In this project, sponsored by the TUES program of the National Science Foundation, students will be able to work on laboratory experiences where they will practice the concepts and skills learned in class and obtain attractive products that will motivate them with the possibilities that Computer Science offers them.
|
10
|
During this semester the students in the Introduction to Computer Programming course will be participating in the project: "Engaging Introductory Programming Laboratory" (EIP). In this project, sponsored by the TUES program of the National Science Foundation, students will be able to work on laboratory experiences where they will practice the concepts and skills learned in class and obtain attractive products that will motivate them with the possibilities that Computer Science offers them.
|
11
|
|
11
|
|
12
|
-Each of the laboratory experiences will use libraries and programming sections that have been developed by professors and students of the Computer Science program of the University of Puerto Rico, Río Piedras campus. When the laboratory experience is completed, the student will not only reinforce the concepts learned in class, but will also get to know products that he or she will be capable of producing with a bit more knowledge and experience in computing.
|
|
|
|
|
12
|
+Each of the laboratory experiences will use libraries and programming sections that have been developed by professors and students of the Computer Science program of the University of Puerto Rico, RÃo Piedras campus. When the laboratory experience is completed, the student will not only reinforce the concepts learned in class, but will also get to know products that he or she will be capable of producing with a bit more knowledge and experience in computing.
|
13
|
|
13
|
|
14
|
In today's laboratory experience you will learn how we will work in the upcoming meetings, how to access the files that will be used, and how to turn in the work. You will also learn to manage the basic elements of Qt, the platform that will allow us to develop and execute projects in C++.
|
14
|
In today's laboratory experience you will learn how we will work in the upcoming meetings, how to access the files that will be used, and how to turn in the work. You will also learn to manage the basic elements of Qt, the platform that will allow us to develop and execute projects in C++.
|
15
|
|
15
|
|
|
|
|
|
155
|
|
155
|
|
156
|
Qt is an application used by professional developers that has many possibilities and options. In each laboratory experience we will see how to use the basic options that we will need during the semester.
|
156
|
Qt is an application used by professional developers that has many possibilities and options. In each laboratory experience we will see how to use the basic options that we will need during the semester.
|
157
|
|
157
|
|
158
|
-For the laboratory, we will mostly use the part for editing programs in C++, but there is also an option to design graphical interfaces. This option was used to incorporate the code that presents the graphical interfaces for the laboratory experiences. Learning to use this option is not part of this course, but you can learn to use it on your own. In https://docs.google.com/file/d/0B_6PcmpWnkFBOXJxVDlUNEVfOFk/edit you can find a presentation, prepared by the student Jonathan Vélez, that shows basic aspects on how to use the option for designing graphical interfaces.
|
|
|
|
|
158
|
+For the laboratory, we will mostly use the part for editing programs in C++, but there is also an option to design graphical interfaces. This option was used to incorporate the code that presents the graphical interfaces for the laboratory experiences. Learning to use this option is not part of this course, but you can learn to use it on your own. In https://docs.google.com/file/d/0B_6PcmpWnkFBOXJxVDlUNEVfOFk/edit you can find a presentation, prepared by the student Jonathan Vélez, that shows basic aspects on how to use the option for designing graphical interfaces.
|
159
|
|
159
|
|
160
|
|
160
|
|
161
|
### Projects in C++
|
161
|
### Projects in C++
|
|
|
|
|
199
|
|
199
|
|
200
|
---
|
200
|
---
|
201
|
|
201
|
|
202
|
-2) Write the name of the project, select the directory where you would like to save it, press `Next` in that window and the following one, and then `Finish` in the next one.
|
|
|
203
|
|
202
|
|
204
|
-This process will create a new Qt project with the skeleton for a basic C++ program that only displays "Hello World!". Before continuing, select `Projects` in the vertical menu to the left. A window called `Build Settings` should appear. In this window, make sure the `Shadow build` checkbox is NOT selected, as shown in Figure 3.
|
|
|
|
|
203
|
+2) Write the name of the project, select the directory where you would like to save it, press `Next` in that window and the following one, and then `Finish` in the next one.
|
205
|
|
204
|
|
|
|
205
|
+ This process will create a new Qt project with the skeleton for a basic C++ program that only displays "Hello World!". Before continuing, select `Projects` in the vertical menu to the left. A window called `Build Settings` should appear. In this window, make sure the `Shadow build` checkbox is NOT selected, as shown in Figure 3.
|
|
|
206
|
+
|
206
|
---
|
207
|
---
|
207
|
|
208
|
|
208
|
![figure3.png](images/figure3.png)
|
209
|
![figure3.png](images/figure3.png)
|
|
|
|
|
211
|
|
212
|
|
212
|
---
|
213
|
---
|
213
|
|
214
|
|
|
|
215
|
+
|
214
|
3) Return to the window where you can edit the program by selecting `Edit` in the left menu and double clicking `Sources` and then `main.cpp`. Press the green arrow on the left menu to execute the program. The results for the program will be displayed in the terminal window. If there were any errors, these would appear in the `Issues` window in Qt.
|
216
|
3) Return to the window where you can edit the program by selecting `Edit` in the left menu and double clicking `Sources` and then `main.cpp`. Press the green arrow on the left menu to execute the program. The results for the program will be displayed in the terminal window. If there were any errors, these would appear in the `Issues` window in Qt.
|
215
|
|
217
|
|
216
|
4) Change the contents of `main.cpp` as such:
|
218
|
4) Change the contents of `main.cpp` as such:
|
|
|
|
|
231
|
|
233
|
|
232
|
### Exercise 2: Download projects from Bitbucket
|
234
|
### Exercise 2: Download projects from Bitbucket
|
233
|
|
235
|
|
234
|
-The files for this laboratory experience are stored in Bitbucket. In each laboratory session, you will download the Bitbucket folder that contains the files for that laboratory experience and you will save them in the `Documents/eip` directory you created in Exercise 0. To download the corresponding folder for this laboratory experience, open the terminal, use the Linux commands to move to the `Documents/eip` directory and write the command `git clone https://bitbucket.org/eip-uprrp/introduccion.git`. Go to the `Documents/eip` directory and verify that it contains the `Introduction` folder.
|
|
|
|
|
236
|
+The files for this laboratory experience are stored in Bitbucket. In each laboratory session, you will download the Bitbucket folder that contains the files for that laboratory experience and you will save them in the `Documents/eip` directory you created in Exercise 0. To download the corresponding folder for this laboratory experience, open the terminal, use the Linux commands to move to the `Documents/eip` directory and write the command `git clone https://bitbucket.org/eip-uprrp/intro-introduccion.git`. Go to the `Documents/eip` directory and verify that it contains the `intro-introduction` folder.
|
235
|
|
237
|
|
236
|
|
238
|
|
237
|
### Exercise 3: Open project already created, compile and run
|
239
|
### Exercise 3: Open project already created, compile and run
|
|
|
|
|
245
|
|
247
|
|
246
|
2) Load the `QtCreator` project called `Practice` by double clicking the file `Practice.pro` in the `Documents/eip/introduction` directory on your computer. In the window that appears, press `Configure Project`.
|
248
|
2) Load the `QtCreator` project called `Practice` by double clicking the file `Practice.pro` in the `Documents/eip/introduction` directory on your computer. In the window that appears, press `Configure Project`.
|
247
|
|
249
|
|
248
|
-Each time you load or start a new project, make sure that `Shadow build` is not selected: in the menu to the left, select `Projects`, then in `Build Settings` verify that the checkbox for `Shadow build` is not selected, as we saw in Figure 3.
|
|
|
|
|
250
|
+ Each time you load or start a new project, make sure that `Shadow build` is not selected: in the menu to the left, select `Projects`, then in `Build Settings` verify that the checkbox for `Shadow build` is not selected, as we saw in Figure 3.
|
249
|
|
251
|
|
250
|
3) As you saw previously, Qt allows you to compile and execute a program by pressing the green arrow that appears in the left column. Press the arrow and notice that you obtain a window of "Issues" that occurred when compiling. The list that appears will show you information that allows you to find and fix the errors.
|
252
|
3) As you saw previously, Qt allows you to compile and execute a program by pressing the green arrow that appears in the left column. Press the arrow and notice that you obtain a window of "Issues" that occurred when compiling. The list that appears will show you information that allows you to find and fix the errors.
|
251
|
|
253
|
|
252
|
4) Select the `main.cpp` file in the `Sources` directory so you can find and fix the errors.
|
254
|
4) Select the `main.cpp` file in the `Sources` directory so you can find and fix the errors.
|
253
|
|
255
|
|
254
|
-Fix all of the errors and press the green arrow once again to compile and execute the program. Once you fix the errors, the program should open a window `Application Output` and display `Exit: 1`.
|
|
|
|
|
256
|
+ Fix all of the errors and press the green arrow once again to compile and execute the program. Once you fix the errors, the program should open a window `Application Output` and display `Exit: 1`.
|
255
|
|
257
|
|
256
|
5) As mentioned earlier, during the compilation and execution process, Qt creates various files we should delete after terminating the program. To do this, in the `Build` option of the Qt menu, select `Clean All`.
|
258
|
5) As mentioned earlier, during the compilation and execution process, Qt creates various files we should delete after terminating the program. To do this, in the `Build` option of the Qt menu, select `Clean All`.
|
257
|
|
259
|
|