Free C++ Lessons (Part 1)

Lessons and tutorials in the Programming Language C.

Definition :

C is a general-purpose computer programming language, it’s one of the most popular programming languages, and designed for implementing system software.

About Dev-C++ :

System : Windows 95/98/NT/2000/XP
Status : Free Software (under the GNU General Public License)
Size : 13.5 Mb

Download

Notes:

  • #include directive tells the preprocessor to treat the contents of a specified file as if those contents had appeared in the source program at the point where the directive appears.
  • You can add more than one “include”.
  • The program has a function main() which starts with { and ends with }.
  • All the functions must be in small characters.
  • The code must be written between braces {}.
  • Programming system (”PAUSE”) is an input function that causes the output DOS window to remain open after the program is executed.

Working with Dev-C++ :

  • Click:  New >Source file ( This will present a template that contains the minimum C++ code needed for a program in Dev-C++).
  • Insert the rest of your program code after the opening brace, {.

  • After you finish writing the program, hit f9 to compile the program, and save your work.

3 Responses

09.11.11

I learnt this before, but I’ve now completed the lesson. Thanks for refreshing my memory. :-)

09.11.11

Sorry for my typing errors.

I learnt this before, but I’ve now completely forgotten this lesson. Thanks for refreshing my memory.

09.11.11

Write a program for a Vendo machine that accepts 1, 5 and 10 peso coins only and display an error message if the user dropped an invalid coin.

The user may dropped as much coins as he wants and the machine will stop accepting coins once the user enters zero. After which, the program will display the total amount of the coins dropped in the machine.

The customer then will select the drinks he/she wants and display the change if there’s any.

If the user select non of the available drinks display an error message.

The program should ask the user if he/she wants to buy another drink.

Listed below are the price equivalent of all the drinks available in the vendo machine. User should select whether HOT or COLD drinks and the choose a specific drink for the category.

Do not forget to include a statement in your program that displays your full name.
Option A for HOT drinks
1 – Capuccino sweetened 15.00
2 – Capuccino unsweetened 12.00
3 – Mocha 15.00
4 – Regular 10.00
5 – Regular with cream 12.00

Option B COLD drinks
1 – Coke regular 20.00
2 – Sprite 20.00
3 – Coke Zero 22.00
4 – Pineapple juice unsweetened 23.00
5 – Pineapple juice sweetened 25.00

can u help me to this program?? tnx

Leave Your Response