Browse Source

README-en.md edited online with Bitbucket

Jose R Ortiz Ubarri 8 years ago
parent
commit
047a660676
1 changed files with 19 additions and 15 deletions
  1. 19
    15
      README-en.md

+ 19
- 15
README-en.md View File

6
 ![main2.png](images/main2.png)
6
 ![main2.png](images/main2.png)
7
 ![main3.png](images/main3.png)
7
 ![main3.png](images/main3.png)
8
 
8
 
9
+[Verano 2016 - Ive]
9
 
10
 
10
 *Object Oriented Programming* (OOP) is a programming paradigm that promotes the design of programs by having different objects interacting together to solve a problem. C++ is one of the programming languages that promotes object oriented programming, allowing programmers to create their own classes from scratch or derive them from other existing classes. Other languages that promote OOP are Java, Python, Javascript and PHP.
11
 *Object Oriented Programming* (OOP) is a programming paradigm that promotes the design of programs by having different objects interacting together to solve a problem. C++ is one of the programming languages that promotes object oriented programming, allowing programmers to create their own classes from scratch or derive them from other existing classes. Other languages that promote OOP are Java, Python, Javascript and PHP.
11
 
12
 
13
 
14
 
14
 When an object class we need to use in our program has not been predefined in a library, we need to declare and implement our own class. To do this, we define *classes* that contain data with certain *properties* or *attributes* and actions that we want to carry out with this data through the use of *methods* or *member functions*. This way, we can organize the information and processes in *objects* that have the properties and methods of a class. In today's laboratory experience you will practice defining a class and implementing some of its methods by completing a program that simulates a basketball game between two players, maintaining the score for the game and the global statistics for the two players.
15
 When an object class we need to use in our program has not been predefined in a library, we need to declare and implement our own class. To do this, we define *classes* that contain data with certain *properties* or *attributes* and actions that we want to carry out with this data through the use of *methods* or *member functions*. This way, we can organize the information and processes in *objects* that have the properties and methods of a class. In today's laboratory experience you will practice defining a class and implementing some of its methods by completing a program that simulates a basketball game between two players, maintaining the score for the game and the global statistics for the two players.
15
 
16
 
16
-##Objectives:
17
+## Objectives:
17
 
18
 
18
-1. Design and define a class.
19
+1. Practice the implementation and declaration of classes in C++.
19
 
20
 
20
-2. Implement methods for a class.
21
+2. Implement methods in a class.
21
 
22
 
22
 
23
 
23
-##Pre-Lab:
24
+## Pre-Lab:
24
 
25
 
25
 Before coming to the laboratory you should have:
26
 Before coming to the laboratory you should have:
26
 
27
 
27
 
28
 
28
-1. Reviewed the concepts related to classes and objects.
29
+1. Reviewed the implementation and declaration of C++ classes.
29
 
30
 
30
 2. Studied the skeleton for the program in `main.cpp`.
31
 2. Studied the skeleton for the program in `main.cpp`.
31
 
32
 
32
 3. Studied the concepts and instructions for the laboratory session.
33
 3. Studied the concepts and instructions for the laboratory session.
33
 
34
 
34
-4. Taken the Pre-Lab quiz that can be found in Moodle.
35
+4. Taken the Pre-Lab quiz available in Moodle.
35
 
36
 
36
 ---
37
 ---
37
 
38
 
38
 ---
39
 ---
39
 
40
 
40
-##The Game
41
+## The Game
41
 
42
 
42
 The skeleton for the program that we provide simulates a basketball game between two players. The successful throws into the basket receive two points. The data is initiated with the name of each player and the global statistics in the "tournament": total of games played, attempted throws, successful throws and rebounds. The program includes random functions and formulas to determine the player that attempts a throw, if the player scores, and  the player that takes the rebound. During the simulated game the score for each player is kept and each player's data is updated. At the end of the game, a table with the statistics is displayed.
43
 The skeleton for the program that we provide simulates a basketball game between two players. The successful throws into the basket receive two points. The data is initiated with the name of each player and the global statistics in the "tournament": total of games played, attempted throws, successful throws and rebounds. The program includes random functions and formulas to determine the player that attempts a throw, if the player scores, and  the player that takes the rebound. During the simulated game the score for each player is kept and each player's data is updated. At the end of the game, a table with the statistics is displayed.
43
 
44
 
64
 
65
 
65
 ---
66
 ---
66
 
67
 
67
-###The `BBPlayer` Class
68
+### The `BBPlayer` Class
68
 
69
 
69
 For this laboratory experience, you will define the `BBPlayer` class that contains the attributes and methods that are described below. Since some of the functions that are already defined in the provided code use attributes and methods of this class, it is important that you use the same names that we indicate. The commented code in the `main` function and in `test_BBPlayer` will help you determine the type of data the method should return, the types the parameters should have, and the order in which they are included in the function declaration.
70
 For this laboratory experience, you will define the `BBPlayer` class that contains the attributes and methods that are described below. Since some of the functions that are already defined in the provided code use attributes and methods of this class, it is important that you use the same names that we indicate. The commented code in the `main` function and in `test_BBPlayer` will help you determine the type of data the method should return, the types the parameters should have, and the order in which they are included in the function declaration.
70
 
71
 
71
 
72
 
72
-####Attributes
73
+#### Attributes
73
 
74
 
74
 * `_name`: stores the name of the player
75
 * `_name`: stores the name of the player
75
 * `_shotsTaken`: stores the number of attempted throws during the tournament
76
 * `_shotsTaken`: stores the number of attempted throws during the tournament
79
 * `_score`: stores the player's score during the game
80
 * `_score`: stores the player's score during the game
80
 
81
 
81
 
82
 
82
-####Methods
83
+#### Methods
83
 
84
 
84
 * default constructor. *(method included in `main.cpp`)*
85
 * default constructor. *(method included in `main.cpp`)*
85
 * `setAll()`: methods that assigns an initial value to all of the attributes of the object. Notice that this method is invoked at the beginning of `main` to assign initial values to the array `P` that is an array of two objects of the `BBPlayer` class.
86
 * `setAll()`: methods that assigns an initial value to all of the attributes of the object. Notice that this method is invoked at the beginning of `main` to assign initial values to the array `P` that is an array of two objects of the `BBPlayer` class.
107
 
108
 
108
 ---
109
 ---
109
 
110
 
110
-##Laboratory Session:
111
+## Laboratory Session:
111
 
112
 
112
-During this laboratory session, your task will be to define the `BBPlayer` class with the attributes and method prototypes listed above. The skeleton for the program includes the code to define some of the methods; others will have to be defined.
113
+In this laboratory experience, your task will be to define the `BBPlayer` class with the attributes and method prototypes listed above. The skeleton for the program includes the code to define some of the methods; others will have to be defined.
113
 
114
 
114
 The skeleton for the program also includes the `test_BBPlayer` function that does unit tests to each of the functions in the program. The tests are commented and, as you define each function, you will remove the comment, test and modify the function, until the test for that function is passed. Once all of the functions are ready and have passed the tests, the whole program is tested by removing the necessary comments in the `main` function.
115
 The skeleton for the program also includes the `test_BBPlayer` function that does unit tests to each of the functions in the program. The tests are commented and, as you define each function, you will remove the comment, test and modify the function, until the test for that function is passed. Once all of the functions are ready and have passed the tests, the whole program is tested by removing the necessary comments in the `main` function.
115
 
116
 
116
 
117
 
117
-###Exercise 0: Download and understand the provided code
118
+### Exercise 1 - Download and understand the provided code
118
 
119
 
119
-####Instructions
120
+#### Instructions:
120
 
121
 
121
-1. Load the `basket01` project onto Qt by double clicking on the `basket01.pro` filein the directory `Documents/eip/Classes-Basket` of your computer. You may also go to `http://bitbucket.org/eip-uprrp/classes-basket` to download the `Classes-Basket` folder to your computer.
122
+1. Load the project  `basket01` into `QtCreator`. There are two ways to do this:
123
+
124
+    * Using the virtual machine: Double click the file `basket01.pro` located in the folder `/home/eip/labs/classes-basket01` of your virtual machine.
125
+    * Downloading the project’s folder from `Bitbucket`: Use a terminal and write the command `git clone http:/bitbucket.org/eip-uprrp/classes-basket01` to download the folder `classes-basket01` from `Bitbucket`. Double click the file `basket01.pro` located in the folder that you downloaded to your computer.
122
 
126
 
123
 2. This program will run on the terminal and you should select this option from the "Projects" window. To access this window, you select "Projects" in the vertical menu to the left. Afterwards, in `Build & Run` you select `Run` and then mark the box that says `Run in terminal`.
127
 2. This program will run on the terminal and you should select this option from the "Projects" window. To access this window, you select "Projects" in the vertical menu to the left. Afterwards, in `Build & Run` you select `Run` and then mark the box that says `Run in terminal`.
124
 
128