|
|
|
|
7
|
[Verano 2016 - Ive]
|
7
|
[Verano 2016 - Ive]
|
8
|
|
8
|
|
9
|
Commonly, when solving a problem, we select among several choices depending on whether certain conditions are met. Computer programs are built to solve problems, so they should have a structure that allows them to make decisions and select alternatives. In C++ selections are structured using `if`, `else`, `else if` or `switch`. Relational expressions and logical operators are common when handling selection structures. In today's laboratory experience you will practice the use of some of these selection structures by completing the design of an application that determines the strength of a password.
|
9
|
Commonly, when solving a problem, we select among several choices depending on whether certain conditions are met. Computer programs are built to solve problems, so they should have a structure that allows them to make decisions and select alternatives. In C++ selections are structured using `if`, `else`, `else if` or `switch`. Relational expressions and logical operators are common when handling selection structures. In today's laboratory experience you will practice the use of some of these selection structures by completing the design of an application that determines the strength of a password.
|
|
|
10
|
+
|
10
|
## Objectives:
|
11
|
## Objectives:
|
11
|
|
12
|
|
12
|
1. Use relational expressions and select adequate logical operators to make decisions.
|
13
|
1. Use relational expressions and select adequate logical operators to make decisions.
|
13
|
-2. Apply decision structures.
|
|
|
|
|
14
|
+2. Apply selection structures.
|
14
|
|
15
|
|
15
|
|
16
|
|
16
|
##Pre-Lab:
|
17
|
##Pre-Lab:
|
|
|
|
|
217
|
|
218
|
|
218
|
1. Load the project `PassworStrength` into `QtCreator`. There are two ways to do this:
|
219
|
1. Load the project `PassworStrength` into `QtCreator`. There are two ways to do this:
|
219
|
|
220
|
|
220
|
- * Using the virtual machine: Double click the file `PassworStrength.pro` located in the folder `/home/eip/labs/conditionals-passwordstrength` of your virtual machine.
|
|
|
221
|
- * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/conditionals-passwordstrength` to download the folder `conditionals-passwordstrength` from `Bitbucket`. Double click the file `PassworStrength.pro` located in the folder that you downloaded to your computer.
|
|
|
|
|
221
|
+ * Using the virtual machine: Double click the file `PassworStrength.pro` located in the folder `/home/eip/labs/selections-passwordstrength` of your virtual machine.
|
|
|
222
|
+ * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/selections-passwordstrength` to download the folder `selections-passwordstrength` from `Bitbucket`. Double click the file `PassworStrength.pro` located in the folder that you downloaded to your computer.
|
222
|
|
223
|
|
223
|
2. Configure the project. The project consists of several files. **You will only write code in the file `readpassword.cpp`. You should not make any changes in the other files.** Despite this, you should familiarize yourself with the functions that are already defined in them, since you will be using some of them to create your code.
|
224
|
2. Configure the project. The project consists of several files. **You will only write code in the file `readpassword.cpp`. You should not make any changes in the other files.** Despite this, you should familiarize yourself with the functions that are already defined in them, since you will be using some of them to create your code.
|
224
|
|
225
|
|
|
|
|
|
337
|
In the project's code you will find examples of how to calculate the first two positive criteria: the number of characters in the password and the numbers of uppercase letters. You can compile and execute the example so you can see the working interface with these two criteria. Part of your task is to add the code to compute the score for the remaining criteria. Remember that you should accumulate the total score and invoke the functions to update the graphical interface.
|
338
|
In the project's code you will find examples of how to calculate the first two positive criteria: the number of characters in the password and the numbers of uppercase letters. You can compile and execute the example so you can see the working interface with these two criteria. Part of your task is to add the code to compute the score for the remaining criteria. Remember that you should accumulate the total score and invoke the functions to update the graphical interface.
|
338
|
|
339
|
|
339
|
|
340
|
|
340
|
-### Exercise 4: Determine and display the password's strength
|
|
|
|
|
341
|
+### Exercise 4 - Determine and display the password's strength
|
341
|
|
342
|
|
342
|
The password is entered in the top section of the graphical interface. The user will input the password in the top section of the graphical interface. Below appears the *report* that contains the different criteria, the count for each criteria, and the individual score for the criteria. This report will be updated as the user inputs the password's characters. The total score will be the sum of all of the points (addition and subtraction) of the individual criteria.
|
343
|
The password is entered in the top section of the graphical interface. The user will input the password in the top section of the graphical interface. Below appears the *report* that contains the different criteria, the count for each criteria, and the individual score for the criteria. This report will be updated as the user inputs the password's characters. The total score will be the sum of all of the points (addition and subtraction) of the individual criteria.
|
343
|
|
344
|
|