[go: up one dir, main page]

0% found this document useful (0 votes)
5 views7 pages

What is a Computer System - Copy

A computer system consists of hardware, software, data, and users that work together to perform tasks. Software is a collection of instructions that tells hardware how to function, and it is divided into system software and application software. The document also covers flow charts, algorithms, Python programming language features, syntax, keywords, identifiers, comments, variables, constants, literals, and data types.

Uploaded by

9aa6l
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views7 pages

What is a Computer System - Copy

A computer system consists of hardware, software, data, and users that work together to perform tasks. Software is a collection of instructions that tells hardware how to function, and it is divided into system software and application software. The document also covers flow charts, algorithms, Python programming language features, syntax, keywords, identifiers, comments, variables, constants, literals, and data types.

Uploaded by

9aa6l
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 7

Q1. What is a computer system ?

Ans - A computer system is a combination of hardware software, data and users that work together to perform
various tasks and processes . It consists of several components :
1. Hardware : This includes physical components like the CPU (Central Processing Unit), Memory (RAM), Storage
Devices, Hard Drive and SSD’s, Input Devices, Output Devices and network equipment .
2. Software : These are the programs and application that instruct the hardware on how to perform task . This
includes the hardware on how to perform task . This includes the operating system(like: Mac OS, Linus, Windows)
Drivers, Utility and application (like: Word processor, Web Browsers and Games)
3. Data : Information in the form of files, document, data bases or any other type of content that the computer
system processes and manipulates .
4. Users : People who interact with the computer system, providing input and receiving output utilizing its capability
to perform task or achieve goal .
Q2. What is a computer software ?
Ans - Software is a collection of instruction, data or computer programs that are used to run machines and carry out
particular activity . Computer software refers to a set of instruction, program or data used to operate computer and
execute specific task it is the intangible aspect of computer system that tells hardware how to function and what task
to perform .
Q3. Define the following terms :
a. Software Instruction : Software instruction refers to the specific commands or directions given to the
computer or an application to perform a particular task or operation. These instructions are written in a
programing language understood by the computer. Each instruction is a line of code that tells the
computer what to do, such as perform calculation, reading or writing data, making decision based on
certain condition (If-else statement), looping, through set of actions multiple times(loops), or calling
predefine function to execute specific operations .
b. Computer Program : A computer program is a set of instruction written in a specific programming
language.
A computer program can be simple as a set of instruction performing a single function or as complex as a
large-scale application handling numerous tasks and interacting with users or other systems.

Software
Software is a set of programs that allows the users to perform a well-defined function or some specified task.
Types of Software:
Software are broadly classified into two types that is system software and application software.
System Software: It is a computer software that help user to run a computer hardware or software and manages the
interaction between them. It directly operates computer hardware and provides basic functionalities to the user as
well as other software to operate smoothly.
Application Software: It is a program/software are and user computer programs developed primarily to provide
specific functionalities to the user. It performs special function or provides function that are much more than the
basic operation of the computer is known as application software.
What is Flow Chart?
Flow Chart is a graphical representation of sequence of steps or actions within an algorithms or program it uses
different shapes and symbols to represent different elements such as start and end points, processes decisions,
inputs, outputs and loops.
Basic symbol used in flow chart design :
S.N Name Shapes Use and Description
o.
1. The Oval symbol indicates start, stop and halt in a
Terminal program logical flow. A pause/halt generally used in
program logic under some error condition. Terminal is the
first and the last symbol in flowchart.
2. Input A parallelogram denotes any function of input/output
Or type of program, instruction that takes input from devices
Output are indicated with parallelogram in a flow chart.
3. A box represents arithmetic instruction.
Processing

4. Diamond symbol represents a decision point. Decision


Decision based operations such as Yes/No, Question, True/False
indicated by diamond in flow chart.
5. Whenever flow chart become complex it spreads more
Connectors than one page it is useful to use connectors to avoid any
confusions. It is represented by a circle.
6. Flow Line indicates the exact sequence in which actions
Flow Line are executed.

Rules for Creating Flow Chart

Rule1: Flow Chart opening statements must be ‘start’ keyword.


Rule2: Flow Chart ending statements must be ‘End’ keywords.
Rule3: All symbol in flow chart must be connected with an arrow line.
Rule4: The decision symbol in the flow chart is associated with an arrow line.

Flow Chart for Printing Table of 2 Using Flow Chart

Start

Input a, b=1, c

Is
b<11

c= a × b

Print c

b= b+1
End
Algorithms
The word Algorithm means “A set of finite rules or instruction to be followed in calculation or other problem solving
operation.”

OR

“A procedure for solving a mathematical problem in a finite number of steps that frequently involves recursive
operations.”

Use of Algorithm
Some Keys areas where algorithms used are used include:

1. Computer
2. Mathematics
3. Operating Research
4. Artificial Intelligence
5. Data Science

Algorithm to add 3 number and print their sum


1. START
2. Declare 3 integer variable num1, num2, and num3.
3. Take the three numbers to added as inputs in variable num1, num2 and num3 respectively.
4. Declare an integer variable sum to store the resultant sum of the 3 numbers.
5. Add the 3 numbers and store the result in the variable sum.
6. Print the value of the variable sum.
7. END

What Is Python?
Python is a high level, general purpose and very popular programing language. Python is being used in web
development, machine learning, and application along with all cutting edge technology in software industry.

Python is being used by all most all tech giant companies like Google, Amazon, Facebook, Instagram, Dropbox, Uber
etc.

It was created by Guido Van Rossum in 1991 and further developed by python software foundation.

Features of Python
1. Interpreted: Python convert source code into an immediate form called byte codes which is then translate into
native language of specific computer to run it.
2. Platform Independent: Python Program can be developed and executed on multiple operating system platforms.
3. Free and Open Source: Redistributable
4. High Level Language: In python no need to take care about low level detail such as managing the memory used
by the programing.
5. Simple: Closer to English language easy to learn.
More emphasis on the solution to the problem rather than the syntax.
6. Embeddable: Python can be used within C/C++ program to give scripting capabilities for the programs users.
7. Robust: Exceptional handling features
Memory management is technical is inbuilt.
8. Rich Library Support: The Python standard library is very vast.

Types of Statement in Python


The Different statement in python are:
Multiline Statement: In python the statement are written in a single line and the last character of these line in New
Line. To extend statement to two or more line can use braces {}, Parentheses (), semi colon (;), comma (,) and
continuous characters /. We can use any of these according to our requirement in the code. With the line continuous
character we can explicitly divide a long statement in numerous line.

Using “/” Explicit line continuation)


In this type of multiline statement, we will be using the line continuation character (/) to split a statement in multiple
lines. Example: a= “My name / is Ram”

Python Syntax
Python Indentation: It refers to the spaces at the beginning of a code line.
Python uses indentation to indicate a block of code.
Example: if a>b:
print (“a is greater”)
else:
print(“b is greater”)
Indentation

Python Keywords
 Keywords are predefined and reserve words used in python programming that have special meaning to the
compiler.
 We cannot use a keyword as a variable name, function name, or any other identifier.
 They are used to define the syntax and structure of python language
 All Keyword accept True, False and None are in lower case and they must be written as they are.

Python Keyword List


 False  del  not  async  exept  raise
 True  else  pass  avait  for  try
 None  finally  return  break  global  with
 and  from  while  class  import
 as  if  yield  def  is
 continue  in  assert  elif  or

Python Identifier
 Identifier are the name given to variable, classes, method etc.
 For Example: language= “python”
 Here language is a variable ‘An identifier’ which holds the value python.

Rules for Naming an Identifier


 Identifier cannot be a keyword .
 Identifier are case sensitive.
 It can have a sequence of letters or digits. However, it must be beginning with a letter or _
 It is a convention to start an identifier with a letter rather _
 Whitespaces are not allowed.
 We cannot use special symbol like !, @, #, $ and so on.

NOTE
 Python is a case sensitive language. This means, Count and count are not the same.
 Always give the identifier name that makes sense.
 Multiple words can be separated using underscore.
Python Comments
 Comments are hints that we add to our code to make sense.
 When executing code by python, interpreter ignore comments.

Following are the different types of comments


Single Line Comment : We use hash (#) symbol to write a single line comment.
Example: #declare a variable
name= ‘John’
# print name
print(name)#name

Multiline Line Comment: Python doesn’t have dedicated multi-line comment syntax like other programing languages
like: C++ and Java.
We can use multiline strings as comments like:
“’ This program takes an input from the users and print it ‘”
name= input(“Enter name”)
print(name)

Why We Use Comment?


We should use comment for following reasons:

Comments make our code readable for future reference.


Comments are used for debugging purposes.
We can use comments for code collaboration as it help peer developer to understand our code.

Python Variable, Constants and


Literals
Python variable
In programing, a variable is a container ‘storage area’ to hold data. For Example: num=10.
Here, num is the variable storing the value 10.

We use assignment operator (=) to assign value to a variable.

NOTE
Python is a type inferred language so you don’t to explicitly define the variable type.

Changing the value of a variable in python


site_name = 'programiz.pro'
print(site_name)

# assigning a new value to site_name


site_name = 'apple.com'

print(site_name)

Output

programiz.pro
apple.com
Example: Assigning multiple value to multiple variable.

a, b, c = 5, 3.2, 'Hello'

print(a) # prints 5
print(b) # prints 3.2
print(c) # prints Hello
Output
5
3.2
Hello

If we want to assign the same value to multiple variables at once, we can do this as:
site1 = site2 = 'programiz.com'

print(site1) # prints programiz.com


print(site2) # prints programiz.com

Python Constants
A constant is a special type of variable whose value cannot be change.
In python, constants are usually and assigned in a module.

Create a constant.py:

# declare constants
PI = 3.14
GRAVITY = 9.8

Create a main.py:

# import constant file we created above


import constant

print(constant.PI) # prints 3.14


print(constant.GRAVITY) # prints 9.8

Python Literals
Literals are the representation of fixed values in a program. They can be numbers, characters, or strings etc.
For Example: ‘Hello World’, 40, 12.5, ‘B’.
Literals often used to assign values to variable or constant.
For Example: name= ‘Ramesh’
In the above expression name is a variable ‘Ramesh’ is a literal

Python Data Types


In computer programming, data types specify the type of data that can be stored inside a variable.
Python Data Types:
Data Types Classes Description
Numeric int, float, complex Holds numeric value
String str Holds sequence of characters
Sequence list, tuple, range Holds collection of items
Mapping dict Holds data key value pair form
Boolean bool Holds either True or False
Set set, frozenset Holds collection of unique items

You might also like