Coureses

Programming Technique I

Information

Course Code: SECJ1013

Section: 05

Lecture: Mr Cik Suhaimi Yusof

Group Member: Omar Alaaeldin Hassan Khater                              

Learn About C++

Learn about C++

 At the beginning of the new semester, I  had no idea on C++.Though I have heard about C++, to be honest,  I even did not imagine what kind of subject it is. I was so afraid if I could adapt to it or learn it. Therefore before C++ class, I searched a lot of information, like what C++ is and what C++ use for. I know it from internet that C++ is a general-purpose object-oriented programming(OOP) language, develop by Bjarne Stroustrup, and is an extension of the C language. It is therefore possible to code C++ in a “C style” or “object-oriented style”.

Anyway I went to take first class with nervousness, but this class did not directly enter C++ but talked about flowchart. The main purpose is that use design tools such as a hierarchy chart, flowchart, or pseudo code  to create a model of the program. there are three types of program:  statement, selection, loop.

1. Statement

f1.png

                    Flowchart

f1.png.1

                   Pseudo code

2. Selection

f1.png.2

f1.png.3

 

3. Loop

f1.png.4

f1.png.5

Finished this chapter, we started studying C++,at the beginning lecture told us what C++ is, and also told us C++ is important programming language because in C++ we can write programs that are very efficient in memory usage and in CPU usage, this programming language is very close to the hardware. So for lecture 2 was all about basic grammar, such as C++ is very sensitive. and what variable and value important is 

f1.png.6            f1.png.7

     cannot run with Struct, should struct

For Control Structure-- IF and LOOP is very important, my friend who is programmer told me, these two structures are useful, after you find all of about IF, LOOP because it can use less code. no matter which programming language. 

f1.png.8       f1.png.10

                 If structure in C++                                                                      Loop with If in C++

For Function is a collection of statements to perform a task, in order to breaking a program up into smaller, manageable functions or modules, it is be easy to change.

f1.png.11  f1.png.12

          Function prototype/calling function                                 passing data by reference

Array is variable that can store a collection of data of the same type such as a list of ID number. When we meet very huge same type of data, to use array is easy to name all and process all data.

f1.png.13

Input And Output: Output formatting can control how outplays for numeric and string data: size, position, number of digits. Input formatting can format field width for use with cin, useful when reading string data to be stored in a character array.

f1.png.14   f1.png.15

                          Output                                                                   Input

Pointers also called pointer variable, it's a variable that holds an address, Because a pointer variable holds the address of another piece of data, it "points" to the data Pointer variables are yet another way using a memory address to work with a piece of data. This means we are responsible for finding the address we want to store in the pointer and correctly using it.

f1.png.16

Structure: the most important point is in C++ construct that allows multiple variables to be grouped together.

f1.png.17

C++ is very complex and difficult for me, there are so many lots of knowledge in C++, these almost can't learn all in one day, but I will never stop learning.