After I wrotes about Secret codes on Samsung Omnia Pro and how Install Ebuddy on Samsung Omnia Pro,
Now I will share you about Learning C++ from Zero.
Preface
What is C++?
C++ is a middle level language program, the development of C.
The type of C++ coding is case sensitive, wrong only one character in coding can make program not run well.
What is Algorithm?
Algorithm is solution methode that programmer use to make a program.
Different algorithm methode will affect the rate of efficiency in making the source code of program.
We will make simple program of Hot Coffee Milk.
#1 Alogrithm:
-Initialization
HotCoffeeMilk < - 0
Cup < - 1
Spoon < - 1
MilkPowder < - 1
Sugar < - 1
HotWater < - 1
-Process
Cup < - Cup + MilkPowder
Cup < - Cup + Sugar
Cup < - Cup + HotWater
Cup < - Cup + HotWater
While Sugar = 1, Coffee = 1, HotWater = 1 and MilkPowder = 1 do
Cup < - Cup + Spoon
if Cup = 30 then
Sugar < - 0
Coffee < - 0
MilkPowder < - 0
{end if}
{end while}
-Finalization
HotCoffeeMilk < - 1
{end procedure}
Explanation,
Initialization is declaration of variable. HotCoffeeMilk set to zero is mean Hot Coffee Milk not ready yet. Cup, Sugar, MilkPowder and HotWater set to 1 is mean the resource already exist. Process is mean the making of Hot Coffee Milk. While sugar and Milk Powder is exist then do stir the ingredients with a spoon. if the ingredients has stirred as much as 30 times then coffee, milk and sugar is considered to have dissolved.
The Codes:
Program Preview:
#2 Alogrithm:
-Initialization
HotCoffeeMilk <- 0
Cup <- 1
Nescafe_3in1 <- 1
HotWater <- 1
-Process
Cup <- Cup + Nescafe_3in1
Cup <- Cup + HotWater
While HotWater = 1 and Nescafe_3in1 = 1 do
Cup <- Cup + Spoon
if Cup = 30 then
Nescafe_3in1 <- 0
{end if}
{end while}
-Finalization
HotCoffeeMilk <- 1
{end procedure}
Explanation:
With Nescafe 3 in 1 More Simple Steps to make a Hot Coffee Milk, right ?
Ingredients of Nescafe 3 in 1 are Coffee + Sugar + MilkPowder
The Codes:
Program Preview:
Conlcusion:
Programming is not only how to code?, but also how to make an efficient steps and more simplify codes.
Thank You for reading my article about Learning C++ from Zero Part 1, If You like with my article please give me a backlink to this blog, I hope after you reading this article gives You another perspective about programming.
Subscribe to:
Post Comments (Atom)
1 comments:
I used MinGW for GCC compiler :)
Post a Comment
leave comment here, thanks for visiting
[Friends Link] [Facebook] [Twitter]