background preloader

To be learned

Facebook Twitter

C++ Programming/Exercises/Iterations. Iterations[edit] Solutions requirements Solutions must: Use only standard C++.Be compilable.Be in accordance to general coding practices. (no esoteric demonstrations are required) and should: Handle error situations, even if behavior is not defined. Please do not add solutions that are 99% similar to another that is already present, if it is an improvement just add it to the existing solution. EXERCISE 1[edit] Write a program that asks the user to type an integer and writes "YOU WIN" if the value is between 56 and 78 (both included). Int main() {int i; cout << "Type a number between 58 and 73: " << endl; cin>>i; if (i>=58 && i<=78) { cout << "YOU WIN" << i << endl; else cout<<"YOU LOSE!

" EXERCISE 2[edit] Write a program that asks the user to type all the integers between 8 and 23 (both included) using a for loop. Solution Alternative solution by Bartosz Radwanski Alternate solution Solution in C Another alternate solution Failed solutions (correct them as an extra exercise) EXERCISE 3[edit]

Computer

How to be a Programmer: A Short, Comprehensive, and Personal Summary. Debugging is the cornerstone of being a programmer. The first meaning of the verb to debug is to remove errors, but the meaning that really matters is to see into the execution of a program by examining it. A programmer that cannot debug effectively is blind. Idealists that think design, or analysis, or complexity theory, or whatnot, are more fundamental are not working programmers. The working programmer does not live in an ideal world.

Even if you are perfect, your are surrounded by and must interact with code written by major software companies, organizations like GNU, and your colleagues. Most of this code is imperfect and imperfectly documented. Without the ability to gain visibility into the execution of this code the slightest bump will throw you permanently. Debugging is about the running of programs, not programs themselves.

To get visibility into the execution of a program you must be able to execute the code and observe something about it. How to Fix Performance Problems. iTools - use the best tools. Learn a New Skill This Weekend. 7.014 Introductory Biology | CosmoLearning Biology. 100 Skills Every Man Should Know: 2008's Ultimate DIY List.

Biology Project - site map.