Notes in Computer (1G) !
Notes in Computer (1G) !
notes in computer
└── ⋆⋅☆⋅⋆ ──┘
✧˚ · . what is programming ?
● techopedia (2020) defines programming as the “implementation of logic to facilitate specified
computing operations and functionality”. it occurs in a variety of languages and can be done in
different applications, domains and programming models.
● wrubel (1959) as cited by blackwell (2002) defined the term as the “spadework” of finding a precise
mathematical formulation and method of solution, possibly notated in a “convenient problem-oriented
language” whose symbols are “most closely related to the mathematical problem to be solved”
✧˚ · . computer components
● hardware - refers to all physical devices or components that a computer is made of.
1. cpu (central processing unit) - the most important part of the computer
- one that runs the software of the computer
- composed of small chips called microprocessors
3. secondary storage devices - type of memory that holds data for a long period of time
- the most common type is a disk drive.
4. input devices - components that collects the data and sends it to the computer
5. output devices - components that formats and presents any data a person or produced for various
devices.
● software - a required component for a computer to function
2. utility programs - performs a specialized task that enhances the computer’s operation and safeguards
data.
3. software development tools - programs used to create, modify, and test software
- examples are assemblers, compilers, and interpreters
● application software - programs that make a computer useful for everyday tasls.
● to program = to give commands (nakov & team, 2019) ex: play a sound, enlarge an image,
multiply two numbers, ping someone.
using System;
class SquareArea
{
public static void Main ()
{
var size = 5;
Console.WriteLine (“Size = “ + size);
Console.WriteLine (“Area = “ + size * size) ;
}
}
● an artificial language (syntax for expression) meant for giving commands to be read, processed and
executed by the computer
language description
visual popular programming languages for building windows and web basic, c# applications
c, c++ powerful advanced programming languages that emphasize flexibility and fast running times. c++ is also object-oriented
java flexible and powerful programming language that runs on many different computer systems. often used to teach object-oriented programming
python simple, yet powerful programming language used for graphics and small applications
java script scripting language used in web applications that provides rich user interfaces for web browsers
● machine language
- comprised of 1s and 0s
- the “native” language of a computer
- bits - binary digits
● 1 byte = 8 bits
● 1kb = 1000 bytes
● 1 mb = 1000 kb
- first generation programming language (1 GL)
● assembly language (2GL)
- uses mnemonics instead of machine language
● natural languages
● compilers - this translates the code from programming language to machine code and checks the text of
the program for errors. after the program has been compiled, it is then executed by the microprocessor
and the operating system. only works for some computer languages like c++, c#, java, swift and go.
● interpreters - this is “a program for executing programs”. it executes commands directly one after the
after the other as it understands not only a single command and sequences of commands but also other
language constructions (evaluations, iterations, functions, etc). examples are python, php and javascript
● development environments (ide) - this is a combination of traditional tools for development of software
applications. it is where code is written, compiled and executed. integrated development environments
integrates a text editor for writing codes, a programming language.
● hang - an event where a computer beomes unresponsive due to either a program or a system itself
becoming unresponsive and no longer taking input
● lag - a slang term for a noticeable decrease in application speed, due to extreme network congestion or
insufficient processing power. this also refers to an application’s failure to respond to inputs in a timely
manner.
● variable - it is a named memory location which temporarily stores data that can change while program is
running
● constant - a named memory location which temporarily stores data that remains the same thoughout
the execution of the program
'*•.¸♡ lesson 2: logic of programming ♡¸.•*'
༉‧₊˚. algorithm
● step by step procedure to solve a problem
● can be expressed using pseudocode and flowchart
༉‧₊˚. pseudocode
● a plain language description for the steps provided in an algorithm. this uses the conventions of a
normal programming language but is mostly intended for human understanding rather than machine
reading. this makes it easier for people to understand problems than reading syntax that may be
confusing. psuedocode is NOT executable
1. terminal
- oval-shaped
- this indicates start, stop and halt in a program’s logic flow
- the first and last symbols in the flowchart
2. input / output
- parallelogram shape
- denotes any function of input/output type
- displays the function on output devices
- used for accepting value and displaying result
3. process
- box shape
- indicates operation like initialization, calculation, etc
- represents arithmetic functions such as addition, subtraction, multiplication, and division
4. decision
- diamond shape
- indicates decision based operations as yes/no or true/false
5. connectors
- circle shape
- used to connect complex flowcharts or ones that spread through more than one page
- used to avoid confusions
6. flow lines
- arrows and lines
- guides the viewer along their flowcharting path
● algorithm can be presented as pseudocode and flowchart !!
pseudocode:
algorithm:
flowchart :
pseudocode :
step 1: enter number
step 2: read number
step 3: if the number is greater than zero
step 4: print “the number is positive”
step 5: if the number is less than zero
step 6: print “the number is negative”
step 7: stop the program
algorithm:
step 1: enter N1
step 2: read N1
step 3: if N1 > 0 print “print the number is positive”
step 4: else print “print the number is negative”
step 5: stop
flowchart:
- trivia : the first language to include object-oriented principles was called simula, released in 1967. now a
number of modern languages use or allow the use of oop.
● oop represents the logical plan of a program as a set of interactions among objects and operations
- object → is anything real or abstract, about which you store both data and operations that manipulate
the data.
- instance → value of object in one particular usage
- class → is an implementation that can be used to create multiple objects with the same structure and
behavior
- subclasses → lower portion of class
- superclass → higher portion of class
● information hiding: the process of hiding details of an object or function. information hiding is a
powerful programming techique because it reduces complexity
● interface: the languages and codes that the applications use to communicate with each other and with
the hardware
● messaging: message passing is a form of communication used in parallel programming and
object-oriented programming
● object: a self-contained entity that consists of both data and procedures to manipulate the data
● procedure: a section of a program that performs a specific task
● abstraction: the process of picking out (abstracting) common features of objects and procedures
● encapsulation: the process of combining elements to create a new entity. a procedure is a type of
encapsulation because it combines a series of computer instructions
● inheritance: a feature that represents the “is a” relationship between different classes
● polymorphism: a programming language’s ability to process objects differently depending on their data
type of class
*ੈ✩‧₊˚ benefits of oop
● when developing a program, a sequence of steps called phases in program development has to be done.
this is often referred to the program development life cycle (PDLC). PDLC is an organized method of
software development that bears many similarities to other development cycles. there are six (6) phases
to PDLC (code-and-fix)
● specifying the problem → designing the program → coding the program → testing & debugging the
program → formalizing the solution → maintaining the program
● syntax - refers to the spelling and grammar of a programming language. computers are inflexible
machines that understand what you type only if you type it in the exact form that the computer expects.
the expected form is called the syntax. programs with syntax errors cannot execute
- documentation consists of written descriptions and procedures about a program and how to use it. it is
done on a continual basis throughout all the steps of the program development process
- documentation is provided for users, operators, programmers
● stella is a pre-school teacher. she needed a simple application that will allow her pupils to learn basic
shapes and color. she also wanted to determine who among her students frequently used the program
and what scores do they obtain
step 1:
problem:
solution:
● visual basic is the third-generation event-driven programming language with integrated development
environment (IDE) from microsoft COM programming model family. visual basic is relatively easy to
learn and use.
● the first version of visual basic, vb 1.0, was announced in the year 1991. the creation of user interface
through a drag and drop design was inspired a beta generator that was developed by alan cooper at
tripod, which was cooper’s company
● visual basic was derived from BASIC and enables the rapid application development (RAD) of
graphical user interface (GUI) applications, access to databases using data access objects, remote data
objects, of activeX data objects, and creation of activeX controls and objects. scripting languages such as
vba and vbscript are syntactically similar to visual basic, but performed differently
● language developed in early 1960’s at dartmouth college. (B) beginner’s (A) all-purpose (S) symbolic (I)
instruction) (C)code
● the core of visual basic was built using the BASIC (beginners all-purpose symbolic instruction code)
which was popular programming language in 1980’s. in mid 1980’s alan cooper during that time also
developed a drag and drop interface in his company “TRIPOD”. microsoft also asked TRIPOD to
develop the same concept into a form building application. tripod developed it and the program was
named ruby. RUBY does not have the capability of doing program but can load libraries through
“gizmos” (additional control) which was then called “visual basic”. microsoft decided to bundle it with
basic.
● microsoft entered into a contract with cooper and his partners to create tripod into a system that is
programmable for windows 3.0. this system was developed under the code name of ruby, which has no
relationship with the ruby programming language
● tripod did not have any programming language at all. microsoft then decided to use ruby in
combination with basic language to develop visual basic.
● the interface of ruby contributed as the “visual” component of the visual basic programming language.
this was then amalgamated with the embedded BASIC engine that was developed for the ceased
“omega” database system of microsoft.
● the introduction of version 5.0, in the month of february in 1997, microsoft exclusively released a visual
basic that was compatible with 32-bit microsoft windows versions. the programmers who had a
preference for writing programs in 16-bit could do it in versions between 4.0 and 5.0
● the final version of classic visual basic was visual basic 6. vb is very user-friendly and that is why most
programmers prefer using it than vb.net
● in 2002, microsoft released visual basic. NET (VB.NET) to replace VB 6. thereafter, visual basic 6 was
declared as a legacy programming language in 2008
● the .net portion was discarded in 2005. all versions of the visual basic programming language released
since 2002 are regarded as the vb.net programming language
● visual basic 2015 was introduced by microsoft in 2015. the company has added many features
particularly features for building mobile applications. visual basic 2015 is a full-pledged object-oriented
programming (oop) language implemented in the .net framework. visual basic 2015 is bundled together
with other programming languages like c++, f#, javascript, python, and more in an ide called visual
studio community 2015
● ide - is an environment that contains all of the tools and features you need to create, run and test your
programs
1. click “tools” on the menu bar and then click “options” to open the options dialog box. click the projects
and solutions.
2. expand the “text editor” node and then expand the “all languages” jode. click “codelens” and then
deselect the “enable codelens” check box
3. click the “debugging” node and then deselect the “step over properties and operators (managed only)”
check box. also deselect the “show elapsed time perftip while debugging” checkbox, which appears at
the bottom of the list
4. click the “ok” button to close the option dialog box
● a user interface is what the user sees and interacts with while an application is running. winows
applicatopns in visual basic are composed of solution, projects and files. a solution is a container that
stores the projects and files for an entire application. a solution can also contain several projects. a
project is also a container, but it stores only the files associated with that particular project.
● this where you create (or design) your application’s graphical user interface, more simply referred to as
gui
● the windows form object, or form, is the foundation for the user interface in a windows application.
you create the user interface by adding other objects, such as buttons and text boxes, to the form.
● the form1.vb source file is referred to as a form file because it contains the code associated with a form.
the code associated with the first form included in a project is automatically stored in a form file named
form1.vb. the code associated with the second form in the same project is stored in a form file named
form2.vb, and so on. because a project can contain many forms and, therefore, many form files, it is a
good practice to give each form file a more meaningful name. doing this will help you keep track of the
various form files in the project. you can use the properties window to change the filename
● solution explorer is a window that displays the file names and other items used in your project. the /vb
extension on one filename indicates that the file a visual basic source file, which is a file that contains the
code associated with the form displayed in the designer window
● the items of this window display in a tree. to expand a node, you can click its + button. to collapse it,
click its - button. to explore an item, you can double-click it. the result depends on the item you
double-clicked.
● the solution explorer can be used to create a new class, a new folder, or a reference. to perform any of
these operations, you can right-click a folder node such as the name of the project, position the mouse
on add and select the desired operation. you can also perform any of these operations from the project
category of the main menu.
● the solution explorer also allows you to rename or delete some of the items that belong to your project
● like everything in an object-oriented language, a file is an object. each object has a set of attributes that
determine its appearance and behavior, the attributes are called properties and are listed in the
properties window. when an object is created, a default value is assigned to each of its properties
● the name of the selected object (in this case, the form1.vb file) appears in the window’s object box. the
window’s properties list has two columns. the left column displays the names of the selected object’s
properties, which can be viewed either alphabetically or by category. however, it’s usually easier to work
with the properties window when the properties are listed in alphabetical order. the right column in the
properties list is called the settings box, and it displays the current value (or setting) of each of the
object’s properties. a brief description of the selected property appears in the description pane.
1. class definition - is a block of code that specifies (or defines) an object’s appearance and behavior.
2. namespaces - contains the code that defines a group of related classes
3. dot member access opeeator - is a period that separates each word in a namespace
4. the name property -
● is a meaningful name that can be assigned to a windows form
● will be used to refer to the object in code (must be unique)
● must begin with a letter and may only contain letters, numbers, and the underscore character
● may not include punctuation characters or space
5. the text property -
● controls the text displayed in the form’s title bar
● form1 is the default value assigned to the text property of the first form in a project
● should also be changed into meaningful values
● the name property is used by the programmer when coding the application. the text property, on the other hand, is read by the
user while the application is running
6. the startposition property - determine the form’s initial position in the screen
7. the font property
● determines the type, style, and size of the font used to display the text on the form
● a font is the general shape of the characters in a text. examples are segoe ui, tahoma and microsoft sans serif.
● font styles may be regular, bold, and italic and may come in different sizes measured in points. (1 point = 1/72 of an inch)
● trivia : recommended font for windows 8 system is segoe ui
8. the size property - changed by selecting it and dragging the sizing handles that appear around a form
9. the toolbox - by default, the toolbox is positioned on the left side of the ide. to change that position, you
can drag its title bar away and dock it to another side of the ide. the toolbox also uses a default width to
show the items on it. if the width is too narrow or too wide, you can change it. to do this, position the
mouse to its right border and drag left or right. the toolbox contains the tools you use when creating
your application’s user interface. each tool represents a class from which an object, such as a button or
text box, can be intantiated. the instantiated objects, called “controls”, will appear on the form. the
toolbox organizes its items in categories and each category is represented by a ..? if the available list of
categories is not enough, you can add a new section of your choice. by default, visual studio hides some
categories because they are judged hardly used. to display these additional sections, you can right-click
anywhere in the toolbox and click “show all”
● toolbox layout category - to use an object of a particular category, you can first click its button. after
selecting a category, it displays its items. in each category, a particular button called pointer is selected by
default. this simply indicates that no item in the group is currently selected. by default, the items in each
category are organized as horizontal wide buttons: alternatively, you can list the items of a category as
buttons of a list view. to do that, you can right-click anywhere in the category and click “list view” to
remove its check box
● the toolbar is segmented into groups of related options, which are separated by vertical bars:
1. the first six icons provide access to the commonly used project and file manipulation options available
though the file and project menus, such as opening and saving files
2. the second group of icons is for undoing and redoing edits and for navigating through your code
3. the third group of icons provides the ability to start (via the green triangle), pause, and stop your
application. you can also use the last three icons in this group to step into your code line by line, step
over entire sections of code, and step out of a procedure