موضوع: Getting Ready to Program الجمعة أبريل 24, 2009 11:04 am
Getting Ready to Program
Programs are written to instruct machines to carry out specific tasks or to solve specific problems. A step-by-step procedure that accomplishes a desired task is called an algorithm. Thus, programming is the activity of communicating algorithms to computers. We have all given instructions to someone in English and then had that person carry out the instructions. The programming process is analogous, except that machines have no tolerance for ambiguity and must have all steps specified in a precise language and in tedious detail.
The Programming Process 1. Specify the task. 2. Discover an algorithm for its solution. 3. Code the algorithm in C . 4. Test the code.
A computer is a digital electronic machine composed of three main components: processor, memory, and input/output devices. The processor is also called the central processing unit, or CPU. The processor carries out instructions that are stored in the memory. Along with the instructions, data also is stored in memory. The processor typically is instructed to manipulate the data in some desired fashion. Input/output devices take information from agents external to the machine and provide information to those agents. Input devices are typically terminal keyboards, disk drives, and tape drives. Output devices are typically terminal screens, printers, disk drives, and tape drives. The physical makeup of a machine can be quite complicated, but the user need not be concerned with the details. The operating system consists of a collection of special programs and has two main purposes. First, the operating system oversees and coordinates the resources of the machine as a whole. For example, when a file is created on a disk, the operating system takes care of the details of locating it in an appropriate place and keeping track of its name, size, and date of creation. Second, the operating system provides tools to users, many of which are useful to the C programmer. Two of these tools are of paramount importance: the text editor and the C compiler. We assume the reader can use a text editor to create and modify files containing C code. C code is also called source code, and a file containing source code is called a ‘source file. After a file containing source code (a program) has been created, the C compiler is invoked. This process is system-dependent. (Section 1.6, Writing and Running a C Program, on page 14.) For example, on many UNIX systems, we can invoke the C compiler with the command CC pgm.cpp where pgm.cpp is the name of a file that contains a program. If there are no errors in pgm.cpp, this command produces an executable file—one that can be run, or executed. Although we think of this as compiling the program, what actually happens is more complicated.
When we compile a simple program, three separate actions occur: First the preprocessor is invoked, then the compiler, and finally the linker. The preprocessor modifies a copy of the source code by including other files and by making other changes. The compiler translates this into object code, which the linker then uses to produce the final executable file. A file that contains object code is called an object file. Object files, unlike source files, usually are not read by humans. When we speak of compiling a program, we really mean invoking the preprocessor, the compiler, and the linker. For a simple program, this is all done with a single command. After the programmer writes a program, it has to be compiled and tested. If modifications are needed, the source code has to be edited again. Thus, part of the programming process consists of this cycle: When the programmer is satisfied with the program performance, the cycle ends.
موضوع: رد: Getting Ready to Program الجمعة أبريل 24, 2009 11:38 am
لو كنا نريد تعلمها بالإنجليزية لتعلمناها من المواقع الإنجليزية والكلام ليس عني لأني أفهم اللغة الإنجليزية لكن التلاميذ الآخرين أقترح عليهم أن يقوموا بإضراب ختى تقوم بالترجمة
موضوع: رد: Getting Ready to Program الجمعة أبريل 24, 2009 12:32 pm
جزاك الله خيرا أخي على تحمسك للتعليم بخصوص اللغة صحيح الحمد لله هناك من يفهم و يجيد اللغة الإنجليزية و هناك من مستواه متوسط و هناك من مستواه ضعيف و حبذا لو تكون الدروس باللغة العربية و لكن ذا لم يكن هناك أي حل بخصوص اللغة فلا بأس فالعلم ليس من السهل إكتسابه فأقترح أن تضع الدرس بالإنجليزية ثم إذا استطعت ترجمته ترجمه