Clout 9

Clout 9 99 ways to get yourself together

13/03/2021

It is vital that children and staff are able to feel safe in their school or college and electronic security solutions provided by KL Systems can help to ensure this is the case, providing a calm, secure environment for students to learn and teachers teach with minimal disruptions.

The introduction of RAW Classic changed the smoking landscape forever by introducing smokers to high quality, truly natu...
27/12/2020

The introduction of RAW Classic changed the smoking landscape forever by introducing smokers to high quality, truly naturally unrefined papers that allow you to enjoy your smoke as nature intended. Grab a small box with 50pcs at UGX 8000

27/12/2020
erffs
11/07/2020

erffs

29/04/2016

NOTICE OF CHANGE
I HERE BY NOTIFY ALL OUR DEAR ESTEEMED PATNERS, CUSTOMERS AND MEMBERS THAT THE COMPANY NAME AND LOGO WILL CHANGE FROM USOFT CO. TO CLOUT9. DUE DATE 1st MAY, 2019

WE WOULD LIKE TO APOLOGISE FOR ANY INCONVINIENCES AND LOSES CAUSED. THANK YOU VERY MUCH

ANY VIEWS AND CONTRIBUTIONS CONTACT
FB: Bihogo Partners
WEB: www.bihogoo.com
TEL: 0704208696

12/02/2016

2. First Programs
Standard Output
Our next step should be to write a program that actually communicates the results of its computations. In order to do that, we will have to introduce a new piece of magic, called standard output. It turns out that standard output is a rather involved notion, so, for the purposes of this chapter, we will pretend that this standard output thing is a piece of paper. In other words, all the programs that we shall write will "communicate" their results on a piece of paper. We can write 'STDOUT:' at the top of this paper so that we know what the paper stands for.
When writing a C++ program we will be referring to standard output by virtue of a word cout (pronounced see-out). This word is an abbreviation for "character output" because everything, regardless of its true nature, is sent to standard output in the form of characters. Without further ado, we present you with the same program rewritten so that it writes out its result on a piece of paper:
int main()
{
cout

10/02/2016

A First Program
Any C++ program we write will be composed of a sequence of statements, like the ones we have just written, enclosed inside a piece of magic called the function 'main'.
For example, to make a program out of the statement
5 + 3.14;
we would have to write the following:
int main()
{
5 + 3.14;
}
By doing this, the statement '5 + 3.14;' has been made a part of a so-called function 'main'. This so-called function makes up the main (and in this case, the only) part of our program.
To execute this statement, we have to execute the expression it contains. An expression is executed by evaluation, it is as simple as that. In this case the expression 5 + 3.14 evaluates to the number 8.14.
However, what is the meaning of a semicolon symbol? In addition to being a way to terminate expressions and mark the end of a statement, it instructs the reader or the executor of the program to discard the value of the expression preceding it.
Now, this must strike you as bizarre! Why would one make an effort to obtain the result of adding 5 to 3.14 only to throw it away in the end?
Think of it this way. Say you tell your friend: "Calculate what 5+3.14 evaluates to!" in a rather imperative voice. Normally, you would expect him to respond with the result: "8.14!" However, should he not have understood your unstated request, you could quickly clarify it by saying: "Now tell me the result!" Having done that, you would have explicitly stated your true request, leaving no room for confusion.
In computer programming we do not have such a luxury. If we are to be understood at all, we have to make the extra effort and state explicitly and upfront that we would like to know the result of a particular computation. Since we have done no such thing in this program, the result of computing the expression 5 + 3.14 will be discarded and the whole effort rendered useless.

09/02/2016

Programming for Beginners - Contents > 2. First Programs >
2. First Programs
This chapter is special in one aspect. Instead of using a computer, it requires you to do a few simple tasks in the old-fashioned way, on a piece of paper. So, to get ready, pick up a pencil and a few pieces of paper now. Afterwards, in the chapter 3, you will learn how to run your programs using a computer.
Learning a programming language is not completely unlike learning a foreign language. In this chapter, the basic constructions that the programming language C++ employs will be introduced.
Just like with any other language, sentences in the programming language C++ are made out of words. Considering that C++ is a language focused on computation, it should not be surprising that numbers are amongst the most frequent words employed. Words of this kind are combined into "sentences" using symbols such as addition (+), multiplication (*), subtraction (-) and division (/). In the programming language C++, combinations of these numbers and symbols look quite like standard arithmetic expressions. For example
5 + 3.14
or:
7+2*6
In programming languages terminology, these are known as expressions.
The process of finding out the value of an expression is called the evaluation. Evaluating an expression is the same as calculating or computing its result. Therefore, values of the preceding two expressions can be evaluated:
⦁ the expression 5 + 3.14 is evaluated to the value 8.14
⦁ the expression 7+2*6 is evaluated to the value 19
One thing that has to be pointed out here is that expressions are not exactly valid C++ sentences. All that needs to be done in order to make those two expressions into valid C++ sentences is to terminate them by a semicolon like this:
5 + 3.14;

7+2*6;
An expression terminated by a semicolon is one way of creating a statement.

15/01/2016

Creativity is intelligence having fun

Address

Kampala
256

Website

Alerts

Be the first to know and let us send you an email when Clout 9 posts news and promotions. Your email address will not be used for any other purpose, and you can unsubscribe at any time.

Contact The Business

Send a message to Clout 9:

Share

Category