Remember: in C++, a frequent thing that needs to be done is to test (use debugging code) to check that there are no mistakes. Why? Mistakes could be solved easily, but if there are too many all of them would be hard to solve. Plus, if an entire program was…
Chase
C++ stoi()
In C++, the stoi() function is useful to change strings to integers. Basically, it only needs one parameter, and it is like stoi(something). Example: Example Output: And that’s all! In short, stoi() is a function that converts strings into integers.
CCC ’21 J4 – Solution
Arranging Books is a coding problem that can be viewed here. It isn’t easy, and is literally impossible to solve it correctly by actually swapping books. Here is the problem: Canadian Computing Competition: 2021 Stage 1, Junior #4 Valentina wants books on a shelf to be arranged in a particular…
C++ substr()
In C++, the substr() method is one of the easiest functions to use to split a string into multiple slices. Here are the parameters of the substr(): where name is the string that you want to be sliced, position is the staring point, and len is the number of characters…
Don’t Borrow Money to Buy Stocks!
When trying to earn money investing stocks, remember not to borrow money from the bank to buy them! There would be a huge profit if you get money from buying and selling them, but what if the stock goes down and you lose money? You wouldn’t have enought money to…
Should Protests be Allowed?
Protests should be allowed freely to express one’s right and choice. One of the basic reasons is people need freedom. We deserve the right to make our own choices. If people protest against the same issue, they realize that they aren’t alone. By protesting, humans will feel better because they…
Should Face Masks be Mandatory during Covid-19?
Face masks should be mandatory during Covid-19 for many reasons. Fundamentally, this virus spreads mainly be the mouth, like when someone sneezes. However, if something like that happens when the person is wearing a mask, Covid-19 will not be that easy to outspread. Alternatively, masks can protect us in various…
What is Python?
Python is a popular programming language created by Guido van Rossum, and released in 1991. It is used for: software development mathematics What can Python do? Python can connect to database systems. It can also read and change files. Python can be used to handle big data and perform complex…
The Dangers of Forest Fires and Preventive Strategies
There are many ways a forest fire is extremely dangerous. One reason is the smoke from the fires can damage the health of people and other living things. Unfortunate enough, the bad air goes to the lungs of people, causing breathing issues and we may die. Secondly, forest fires can…
How to Find if a Number is Divisible by Another (Up to 20)
1: Yes. 2: Examine the last digit of N. If it is an even number, then N is divisible by 2. 3: Add the sum of the digits of N and call it P. If P is divisible by 3, than N is divisible by 3. 4: Take the last…
