The final boss has been defeated!

--Originally published at Programming Path

At last our final project is finished! It was very interesting to make the code, and to make it run properly. My partner Sergio Iriarte and I decided to program a little game, this was because we both like video games and it sound fun to make a game. It felt more like an achievement.

We came up with the idea of programming the game Battleship. Sergio knows how to program in Java after taking some classes on past years, so we decided to do the game in Java. The reasons were because it is a more simple way of programming, is better organized and much easier to use than C++. And of course he was very patient with me because I am new to this thing they call programming.

After making the decision, I had to install eclipse, it was a total disaster because my computer was very slow, but in the end we could defeat this troublemaker called Battleship.

Here is the code:

Final1final2final3

And here is how we see it when running:

  • * means the user have missed.
  • ~ means the user did not hit that coordinate.
  • X means the user has hit a ship.

Every round, the game gives the user a hint about where could a ship be.

final4

So this is it. We finally finished the project. Just in time for this post ?

 


Mastery Topics…

--Originally published at Loading…

Number TC1017 Mastery Topic Done? URL to blog post
1 Use of comments ? https://xalli0421.wordpress.com/2017/01/31/numbers-again/
2 C++ Good Style coding conventions ? https://xalli0421.wordpress.com/2017/03/10/distance-gave-us-a-reason-to-love-harder-%F0%9F%92%AB%F0%9F%92%95/
3 Basic types and their use ? https://xalli0421.wordpress.com/2017/02/14/quiz-6/
4 Basic output (print) ? https://xalli0421.wordpress.com/2017/01/20/hello-world-aleluya/
5 Basic user input (text based) ? https://xalli0421.wordpress.com/2017/01/24/lets-have-fun-with-numbers/
6 Calling functions ? https://xalli0421.wordpress.com/2017/02/07/factorial-calculator/
7 Creating functions ? https://xalli0421.wordpress.com/2017/02/07/now-with-functions/
8 Importing and using libraries ? https://xalli0421.wordpress.com/2017/01/28/there-was-quiz-today/
9 Creating and using your own libraries (program with multiple files) ? https://xalli0421.wordpress.com/2017/03/19/ciento-noventa-y-seis/
10 Use of the conditional “if” ? https://xalli0421.wordpress.com/2017/04/18/quiz/
11 Use of “else” with a conditional if ? https://xalli0421.wordpress.com/2017/02/03/xy-and-xx-minimum-and-squares/
12 Nesting of conditional statements (ifs inside ifs) ? https://xalli0421.wordpress.com/2017/01/28/temperature/
13 Use of loops with “while” and “do while” ? https://xalli0421.wordpress.com/2017/01/30/i-have-a-number-chosen-between-1-and-100/
14 Use of loops with “for” ? https://xalli0421.wordpress.com/2017/03/19/ciento-noventa-y-seis/
15 Nested loops ? https://xalli0421.wordpress.com/2017/03/05/fibonacci-number/
16 Use of recursion for repetitive algorithms ? https://xalli0421.wordpress.com/2017/05/03/e2-71828182845904523536/
17 When to use what type of repetition in a program ? https://xalli0421.wordpress.com/2017/05/02/babylonian-method/
18 Creation and use of Arrays/Vectors in C++ ? https://xalli0421.wordpress.com/2017/03/03/list/
19 Creation and use of strings ? https://xalli0421.wordpress.com/2017/05/02/multipart-data-files/
20 Validated user input (ensure correct/expected data entry) ? https://xalli0421.wordpress.com/2017/02/07/factorial-calculator/
21 Reading and writing of text files ? https://xalli0421.wordpress.com/2017/05/03/go-bananas-or-not-sos/
22 Matrixes and Vectors ? https://xalli0421.wordpress.com/2017/03/03/list/
23 Data analysis with tools (to be determined which tool, most likely SciLab) ☹️
24 Visualization of data with tools  ☹️
Transversal Topics
1 Ability to create C++ file and run from command line (terminal) ?
2 Create accounts: Blog, Twitter, GitHub ?
3 Submit work via Blog RSS and GitHub ?
4 Demonstrate use of Linux sufficient for quizzes/exams ?
5 Install Linux on their own computer ?
6 Ability to create C++ project in IDE and run inside the IDE (advanced topic, not needed early) ?

Bananas Bananas Bananas

--Originally published at my programming blog

What I needed to do:

Write a function called find_bananas which receives a single parameter called filename (a string) and returns a positive integer which is the number of times the word (string) “banana”  (or “BANANA” ) is found in the file. The banana can be any case (‘BaNana’ or ‘BANANA’ or ‘banana’, etc) and they can be “stuck together” like “banAnaBANANA” (that counts as two). Create your own test file (plain text) to check your work.

Thanks to this tutorial and this post.

So what I did was:

  1. I imported the library of fstream
  2. In the first function I did a for loop where if i is smaller than the length then with the function to lower the program will change all the letters to lower case.
  3. I also did an infinite loop (That’s why it has a 1 as a condition) this loop will only stop if you break it and in this I find the number of bananas of each line, and the program saves that info.
  4. Then at the end there is a break to end the infinite loop
  5. This function will return the number of bananas in each line
  6. Then in the next function I open the text file and read it and I made a counter that counts the accumulating bananas in each line of the text
  7. Finally in the int main I have a final counter and this will use the last functions and the return values will be returned.

Screen Shot 2017-05-02 at 1.34.20 AMScreen Shot 2017-05-02 at 1.34.28 AMScreen Shot 2017-05-02 at 1.34.37 AMScreen Shot 2017-05-02 at 1.34.46 AM

Screen Shot 2017-05-02 at 1.34.01 AM.png

My code in Github: https://gist.github.com/mariasantoyodl/31c998d729a8e608a0abfe31e59cf8e5


Post of the weeks #11,12,13,14,15 and 16 what things I learned in these weeks ? And Index of Mastery Topics

--Originally published at Solving Problems with Programming

Picture of author

First let me tell you that  I learn and achieved all transversal topics and you can see it in the following link: Post of the week #3 what things i learned in this week #3 ? And Index of Mastery Topics

I also explain my project and formed a small team that corresponds of completing this ability to create C++ project in IDE and run inside the IDE and can be explained in my post My Project For the Course TC1017 and Expo Ing. Let’s code!

Futhermore, I am going to present the report of all the Mastery Topics achieved in this week:

  1. #Mastery01 Use of comments, achieved in: Post of the week #2 what things i learned in this week #2 ?
  2. #Mastery02 C++ Good Style coding conventions, achieved in: Post of the week #2 what things i learned in this week #2 ?
  3. #Mastery03 Basic types and their use, achieved in: Post of the week #2 what things i learned in this week #2 ?
  4. #Mastery04 Basic output (print), achieved in: Post of the week #2 what things i learned in this week #2 ?
  5. #Mastery05 Basic user input (text based), achieved in: Post of the week #2 what things i learned in this week #2 ?
  6. #Mastery06 Calling functions, achieved in: #Quiz03. Also here:#WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  7. #Mastery07 Creating functions, achieved in: #Quiz03. Also here: #WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  8. #Mastery08 Importing and using libraries, achieved in: Post of the week #1 what things i learned in this week #1 ? Also in #WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  9. #Mastery09 Creating and using your own libraries (program with multiple files), achieved in: #Quiz03. Furthermore, also in here: #WSQ08 Yo soy 196 11/03/17 and WSQ08.cpp
  10. #Mastery10 Use of the conditional “if”,
    Continue reading "Post of the weeks #11,12,13,14,15 and 16 what things I learned in these weeks ? And Index of Mastery Topics"

#WSQ12 Estimating e 15/04/17 and WSQ12.cpp

--Originally published at Solving Problems with Programming

So in this fourteen week class I started with doing this WSQ12 I started reviewing in creating and calling functions in C++.#Mastery06, #Mastery07, #Mastery16 Use of recursion for repetitive algorithms, #Mastery17 When to use what type of repetition in a program, #Mastery18 Creation and use of Arrays/ Vectors in C++. Furthermore, in this stage I have all the topics of the course from 1 to 22.

What I did for this numeric program is solving the problem to the user by creating a program with writing this assignment where I will estimate the mathematical constant e. I should create a function called calculuate_e which receives one parameter called precision that should specify the number of decimal points of accuracy.

I will want to use the infinite series to calculate the value, stopping when the accuracy is reached (previous and current calculation are the same at the specified accuracy).

Hence, the resources I need it to solve this program are here:

For doing this tutorial you need to do the factorial, therefore you need to see my tutorial #WSQ06 Factorial Calculator 12/02/17 and WSQ06.cpp

ken bauer

And the next picture shows us how the number e is calculated with infinite series and I will do this infinite serie in c++

Resultado de imagen para e number

Link of picture

The following photograph shows the solution to this problem:

w1

w2

w3

p666

So at first I wrote the same structure of the program just did the same as what i did in Hello World: Second Class, Second Blog (Blog of the second class 12/01/17) and Hello World.cpp,  #WSQ01 Post Fun with Numbers 16/01/17 and WSQ1.cpp#WSQ02 Post Temperature 23/01/17 and WSQ02.cpp#WSQ03 Post Pick a Number 23/01/17 and WSQ03.cpp#WSQ04 Post Sum of Numbers 23/01/17 and WSQ04.cpp#WSQ05 Six Tutorial On To Functions 12/02/17 and

eular
Continue reading "#WSQ12 Estimating e 15/04/17 and WSQ12.cpp"

#WSQ11 Go Bananas 15/04/17 and WSQ11.cpp

--Originally published at Solving Problems with Programming

So in this fourteen week class I started with doing this WSQ11 I started reviewing in creating and calling functions in C++.#Mastery06, #Mastery07, #Mastery16 Use of recursion for repetitive algorithms, #Mastery17 When to use what type of repetition in a program, #Mastery18 Creation and use of Arrays/ Vectors in C++. Furthermore, in this stage I have all the topics of the course from 1 to 22 including #Mastery22 Matrixes and vectors because in this code I use a matrix with a dimension of 1.

What I did for this numeric program is solving the problem to the user by creating a program with writing a function called find_bananas which receives a single parameter called filename (a string) and returns a positive integer which is the number of times the word (string) “banana”  (or “BANANA” ) is found in the file. The banana can be any case (‘BaNana’ or ‘BANANA’ or ‘banana’, etc) and they can be “stuck together” like “banAnaBANANA” (that counts as two). Create your own test file (plain text) to check your work.

Hence, the resources I need it to solve this program are here:

ken bauer

Video to convert higher to lower cases from the .txt file

The following photograph shows the solution to this problem:

wsq11v1

wsq11v2wsq11v3wsq11v4a1

a2

a3a4

So at first I wrote the same structure of the program just did the same as what i did in Hello World: Second Class, Second Blog (Blog of the second class 12/01/17) and Hello World.cpp,  #WSQ01 Post Fun with Numbers 16/01/17 and WSQ1.cpp#WSQ02 Post Temperature 23/01/17 and WSQ02.cpp#WSQ03 Post Pick a Number 23/01/17 and WSQ03.cpp#WSQ04 Post Sum of Numbers 23/01/17 and WSQ04.cpp#WSQ05 Six Tutorial On To Functions 12/02/17 and WSQ05.cpp#WSQ06 Factorial Calculator 12/02/17 and WSQ06.

vvvv
Continue reading "#WSQ11 Go Bananas 15/04/17 and WSQ11.cpp"

Well… :) not to easy

--Originally published at Tec Life

This was the problem:

Create a program that asks the user for 10 numbers  (floating point). Store those numbers in a list. Show to the user the total, average and standard deviation of those numbers.

This was a hard one, in this problem you need to convine everything you know about programming till now… so, not to easy.

The first thing that I do was doing an array of 10 digits and a cout to the user can type his 10 numbers, then I add a counter to now how many times I am going to put a number, and I make a operation that does that the numbers going to add each other, then I put that the average is equal to the sum divided the times I put a number, that was all in the first part.

The second part was to make a function that gives the standard deviation of the numbers I put (image 2), so I search on internet what to do to make that operation and I do the same as the average but a little different, it was a kind of pitágoras.

Captura de pantalla 2017-03-06 a la(s) 08.59.02.pngCaptura de pantalla 2017-03-06 a la(s) 08.59.15.pngCaptura de pantalla 2017-03-06 a la(s) 09.01.05.png


Números, en lista, Ya!

--Originally published at Adal´s Blog



O era actividad ???


En el libro viene una sección donde explican lo básico pero necesario para saber que son los arreglos, con esa información y un apartado de la aplicación Aprende C++ pude hacer el ejercicio
 Paginas de ayuda: