Here you can find more information about arrays: https://www.programarya.com/Cursos/C++/Estructuras-de-Datos/Arreglos-o-Vectores
You can find information about vectors here: http://www.cplusplus.com/reference/vector/vector/?kw=vector
You can find information about strings here: http://www.cplusplus.com/reference/string/string/?kw=string
(Tuve problemas para subir el video por que estaba muy muy lento el internet, por eso apenas lo postee, espero y pueda comprender ken)
]]>To learn how to open and read files i had to read a lot of times the same thing of the “How to think like a computer scientist”
There are special words to do this how ever the esscentials does not need you to import any module which is good for us.
First of all we have to tell python we want to open a file, to do this we must type set a variable and set the open to it like this:
variable = open(“name of the file.txt”, “r”)
It is very important that we put our paraeters in this case within quot marks, as you see up you have to type an ‘r’ after the name of the text which indicates that is reading.
Now we have it open we have to read it.
To read the text we can choose between read line by line orto read all of them.
1 line at a time: variable = previous_variable.readline()
all of them: variable = previous_variable.readlines()
From here you just haveto get creative and do the stuff you want. And just dont remember that always at the end you must close your text with:
variable.close
An example:
archivo = open(‘bananas.txt’, ‘r’)
one = archivo.readline()
print (one)
close.archivo
Hope you enjoy it!
]]>
In simple terms a nested if is when you write an IF inside another IF braces.
This is the basic structure of a nested if.
if( boolean_expression 1) { // Executes when the boolean expression 1 is true if(boolean_expression 2) { // Executes when the boolean expression 2 is true } }
And of course we can nest else if in the similar way as you nest the if statement.
This is an example of a program with nested if-else.
#include <iostream> using namespace std; int main () { int marks = 55; if( marks >= 80) { cout << "U are 1st class !!"; } else { if( marks >= 60) { cout << "U are 2nd class !!"; } else { if( marks >= 40) { cout << "U are 3rd class !!"; } else { cout << "U are fail !!"; } } } return 0; }
And this will be the output:
U are 3rd class !!
-The Admin.
]]>https://www.youtube.com/channel/UCaUVAH-AvAlHJoMmiYES9Bg/videos
]]>For writting files you first need to open it, for that you need a library that’s call “fstream”, that helps to read and write on files. As the example shows, you need to use the function open and put the name of the file with the respective type of file that is (ex. .txt, .jpeg, etc).
And if you want to write on the text you do need to put the name of the file and then put and output and with “” write whatever you want to write.
]]>
Masterie 8 and 21: https://www.youtube.com/watch?v=5N4_ylfjvBI&feature=youtu.be&hd=1
Masterie 2 and 9: https://www.youtube.com/watch?v=ywiEexzfTAc&feature=youtu.be&hd=1
]]>Believe me Windows Users, there is a better world outside and it’s called Linux.
]]>