Computer Programming I Module Overview

0% found this document useful (0 votes)
62 views7 pages
The document provides information about Cavite State University including its vision, mission, and campus goals. Specifically: 1. Cavite State University's vision is to be the premier unive…

Uploaded by

Mr. Epiphany

Cavite State University

Silang Campus

DCIT22-Computer Programming I Learning Module 1


CvSU Vision

The premier university in historic Cavite recognized


for excellence in the development of globally competitive
and morally upright individuals.

CvSU Mission

Cavite State University shall provide excellent, equitable and relevant


educational opportunities in the arts, science and technology through quality
instruction and relevant research and development activities.
It shall produce professional, skilled and morally upright individuals for
global competitiveness.

Campus Goals

Develop a highly competent human resource by ensuring an enriching


environment to promote professional growth, career advancement for faculty,
staff and students. Provide quality instruction and develop-oriented researches
in cooperation with various institution for the benefit of the community. Respond
effectively to the needs, demands and requirements of the community to
demonstrate the University’s mission of relevance and leadership.
Institutionalize quality assurance policies to keep abreast with national and
international standards of excellence to realize competitiveness in the campus’
products and services.

DCIT22-Computer Programming I Learning Module 2


MODULE II

MODULE II. INTRODUCTION TO


PROGRAMMING

Learning Objectives:
 Show different programming language;
 Identify the program development cycle;
 Analyze the uses of concepts, variables and data types.

What is Computer Program?


 As a noun,it is also called an Application or Software
 A set of instructions that process input, manipulate data and output result
 To program a computer,writing of instructions,statements or commands that instruct the
computer how to process data.
 There are several programming languages used to program a computer

They say that a computer is a useful tool for solving many problems, but the computer relies
on human to give instructions for them to complete specific [Link] instructions are
called programs and the person who creates the program is called programmer.

So when the computer receives an instruction the computer reads it as 1 and 0 because the
computer can only understand on and off switches represented as 1’s and 0’s because it is
powered by electricity. These 1’s and 0’s are also known as machine-level language or low-
level language. The assembly language was developed which simplifies the big task of
series of writing of 1’s and 0’s through alphabetic abbreviations called mnemonic code.

DCIT22-Computer Programming I Learning Module 3


MODULE II
Programs written is assembly language require an
assembler (other program) to convert the assembly
code to machine [Link] through time, the instruction
evolves into the English language also known as
high-level language. The language requires either an
interpreter or a compiler to convert the English-like
instructions into machine language.

Programming Language

 Allow us to give instructions to a computer in


a language the computer understands.

 These languages allow computers to quickly and efficiently process large and complex
[Link] are dozens of Programming Language(PL) used in industry today
 For Example:C,C++,C#,[Link], etc. These are the examples of a compiler that can
translate the instruction from high-level language which human can understand to
machine-level language that the computer can understands.

C++ Programming Language

 C++ is a general purpose,object-oriented,middle-level programming language


 Extension of C Programming Language,which makes it possible to code C++ in a “C
Style”
 C++ is used to create computer programs and
 packaged software,such as games,office applications,graphics and video editors and
operating system.
 Blackberry OS is developed using C++
 Newest Microsoft Office suite was developed using C++

DCIT22-Computer Programming I Learning Module 4


MODULE II
Structure of C++ Programming Language

Source Codes Explanation:

This is a comment line. All lines beginning with two slash signs (//) are considered comments
and do not have any effect on the behavior of the program. The programmer can use them
to include short explanations or observations within the source code itself.

In this case the directive #include <iostream> tells the preprocessor to include the
iostream standard [Link] specific file (iostream)
includes the declarations of the basic standard input-output library in C++, and it is
included because its functionality is going to be used later in the program.

DCIT22-Computer Programming I Learning Module 5


MODULE II

All the elements of the standard C++ library


are declared within what is called a namespace, the
namespace with the name std. So in order to access its functionality we declare with
this expression that we will be using these entities.

The main function is the point by where all C++ programs start their execution,
independently of its location within the source code. It does not matter whether there
are other functions with other names defined before or after it.

“cout” represents the standard output stream in C++, and the meaning of the entire
statement is to insert a sequence of characters (in this case the Hello World
sequence of characters) into the standard output stream (which usually is the
screen).

The return statement causes the main function to finish. return may be followed by a return
code (in our example is followed by the return code 0). A return code of 0 for the main
function is generally interpreted as the program worked as expected without any errors
during its execution.

DCIT22-Computer Programming I Learning Module 6


MODULE II

RESERVED WORDS

Reserved words are like keywords. It consists of letters in


lowercase. It cannot be redefined with any [Link]
examples of reserved words are int,float, void and return.

IDENTIFIER

Identifiers are names that appear in programs. Some of its examples are variables,
constants and functions. Some identifiers are predefined (Example: cout, cin). Some are
defined by the users.

WHITESPACES

White spaces are the blanks, tabs and new lines. It is used to separate special
symbols,reserved words and identifiers. They make programs more readable.

DCIT22-Computer Programming I Learning Module 7

Common questions

Powered by AI

Identifiers and reserved words in C++ differ fundamentally in role and usage. Identifiers name variables, functions, or other entities, and can be assigned by the user as long as they conform to naming conventions. Reserved words, however, are part of the language syntax and have predefined meanings (e.g., 'int', 'return'). They cannot be redefined by the programmer as identifiers, ensuring that they serve a special function in the language syntax and semantics .

Comments, indicated by two slash signs (//), are important as they allow programmers to include explanations or notes within the source code without affecting the program's behavior. The #include <iostream> directive is crucial as it instructs the preprocessor to include the input-output stream library, enabling functionalities like standard input and output operations (e.g., using 'cout' for output).

Assembly languages offer the significant advantage of being more readable and manageable than machine languages by using mnemonic codes instead of binary sequences. This simplification allows for easier programming and debugging compared to the binary code of machine languages, making assembly languages a useful intermediary between low-level machine code and high-level languages. However, they still require an assembler for translation into machine code and do not entirely abstract hardware complexities, which high-level languages address more effectively .

CvSU's education philosophy emphasizes professional growth by providing a robust environment for learning and innovation in courses like Computer Programming I. This course is designed not only to impart fundamental programming skills but also to promote critical thinking and problem-solving abilities, essential for career advancement. Through structured curricula that integrate both theoretical and applied aspects of computer science, students are encouraged to pursue continuous development, aligning with CvSU's goal of nurturing a competent human resource base capable of meeting global industry standards .

The learning objectives of Cavite State University's programming course include demonstrating different programming languages, identifying program development cycles, and analyzing the use of concepts, variables, and data types. These objectives integrate theoretical knowledge with practical application, preparing students for real-world problem-solving. By covering both high-level language use and the underlying principles such as data manipulation and program structure, the objectives support a comprehensive education that aligns with the university's mission to deliver relevant and globally competitive educational opportunities .

High-level programming languages allow us to give instructions to a computer in a language that is easy for humans to understand. These languages, such as C, C++, and VB.net, are translated into machine language by compilers or interpreters, which the computer can understand as a series of 1's and 0's (on and off switches). This contrasts with machine-level language, which consists entirely of binary code directly executed by a computer's CPU without needing translation .

Namespaces in C++ enhance modularity by organizing code into logical scopes, which prevents naming conflicts. A namespace allows declaration of methods, variables, and functions in a way that distinguishes them from others with the same name elsewhere in the program or included libraries. The 'std' namespace, for instance, is used to access elements of the C++ Standard Library without causing conflicts with user-defined names .

Interpreters and compilers both translate high-level programming languages into machine code, but they do so differently. A compiler translates the entire code into machine language before execution, which often occurs once and then reused. This can make compiled code run faster. In contrast, an interpreter translates code line-by-line during execution, which can be less efficient but allows for easier debugging. Thus, both serve the same fundamental purpose but differ in their approach to executing programs .

Cavite State University's mission focuses on delivering excellent, equitable, and relevant educational opportunities in arts, science, and technology through quality instruction and research. This aligns with the goal of providing globally competitive education in programming and technology by developing competent human resources and maintaining quality assurance policies that adhere to international standards. The curriculum in programming, thus, aims to produce skilled professionals who can thrive in a global market, addressing community needs and fostering professional growth .

The 'main' function is crucial in C++ as it serves as the entry point for program execution. All C++ programs start execution from the 'main' function, regardless of its position within the source code. Its completion or 'return' initiates the end of program execution. A return value of 0 typically signals that the program has executed without errors, marking a standard practice for validating program outcomes .

You might also like