Chapter 1 :Algorithm and Flowchart
#Algorithm
1. Write an algorithm to eat your dinner.
2. Write an algorithm to buy a pen.
3. Write an algorithm to turn on the computer.
4. Write an algorithm to download an application(app) on mobile phone.
5. Write an algorithm to stay for online classes.
1. Write an algorithm to add 10 and 20
Step 1: Start
Step 2: a=10, b=20
Step 3: sum= a+b
Step 4: Print sum
Step 5: End
2. Write an algorithm to add two numbers
Step 1: Start
Step 2: Input a,b
Step 3: sum= a+b
Step 4: Print sum
Step 5: End
3. Write an algorithm to subtract three numbers.
Step 1: Start
Step 2: Input a,b and c
Step 3: difference= a-b-c
Step 4: Print difference
Step 5: End
Step 1: Start
Step 2: Input a and b
Step 3: product= a*b
Step 4: Print product
Step 5: End
Step 1: Start
Step 2: Input a and b
Step 3: divide= a/b
Step 4: Print divide
Step 5: End
6.Write an algorithm to find area of square (hint: area of square=L*L)
Step 1: Start
Step 2: Input L
Step 3:area of square= L*L
Step 4: Print area of square
Step 5: End
7.Write an algorithm to find area of rectangle (hint: area of rectangle=L*b)
Step 1: Start
Step 2: Input L and b
Step 3:area of rectangle= L*b
Step 4: Print area of rectangle
Step 5: End
8. Write an algorithm to find area of circle.(hint: area of circle=3.14*r*r)
Step 1: Start
Step 2: Input r
Step 3:area of circle=3.14*r*r
Step 4: Print area of circle
Step 5: End
Step 1: Start
Step 2: Input L
Step 3:perimeter of square=4*L
Step 4: Print perimeter of square
Step 5: End
10. Write an algorithm to find perimeter of rectangle.(hint: area of square=2*(L+b)
Step 1: Start
Step 2: Input L abd b
Step 3:perimeter of rectangle=2*(L+b)
Step 4: Print perimeter of rectangle
Step 5: End
11. Write an algorithm to find out greatest of any three given number.
Step 1: start
Step 2:Input a, b and c
Step 3: if a>b and a>c then
Step 4: Print a is greatest else b>c and b>a
Step 5: Print b is greatest else Print c is greatest
Step 6: Stop
Step 2:Input L,b and h
Step 3:volume=L*b*h
Step 4: Print volume
Flowchart
A flowchart can also be defined as a diagrammatic representation of an algorithm.
The flowchart shows the steps as boxes of various kinds, and their order by connecting the boxes with arrows.
1. Draw a flowchart to add 10 and 20.
4. Draw a flowchart to take input from user and subtract those number.
5. Draw a flowchart to find area of square.
6. Draw a flowchart to find area of circle.
7. Draw a flowchart to find perimeter of rectangle.
8. Draw a flowchart to find perimeter of square.
9. Draw a flowchart to find volume of cube.
10.Draw a flowchart to find volume of cuboid.
Answer the following questions.
What is a program?
A set of instructions that tells the computer how to solve a problem or perform a task is known as a program.
What is an algorithm? List out any three properties of an algorithm.
algorithm has the following properties:
Each step of the algorithm should be simple.
The logic of each step should be clear.
It should be effective.
An algorithm must come to an end after a finite number of steps.
Every step of the algorithm must be accurate. At the same time, it must have a time limit for execution.
The output must be logically correct.
What are the advantages of an algorithm?
They are simple to understand and provide a step-by-step solution for a problem.
Errors can be pointed out very easily. Debugging is simple.
They do not depend on any of the programming languages.
They are compatible with computer languages.
What are the disadvantages of an algorithm?
Disadvantages
Algorithms are time-consuming.
Big tasks are difficult to put in algorithms.
Difficult to show branching and looping in algorithms.
Understanding complex logic through algorithms can be very difficult.
What do you understand by the term flowchart?
State any three advantages and disadvantages of a flowchart.
advantages
It helps in reviewing and debugging a program.
It helps to detect deficiencies in the problem statement.
It helps the programmer in developing the program logic and to serve as documentation for future reference for a completed program.
It helps in the discussion of a solution with others or in explaining the program to others.
Disadvantages
Drawing a flowchart is time consuming.
Making changes in the flowchart is not an easy job. Re-drawing of flowchart is required.
If the logic of the problem is complex, the flowchart becomes complicated.
Flowchart cannot be directly converted into program code.
What are the various basic symbols used in flowcharting? Give their pictorial representation.
What is a pseudocode? What are the advantages and disadvantages of pseudocode?
An informal language used to express the flow of a program is known as pseudo code.
The advantages of pseudocode are listed below:
Writing of pseudocode involves less time and effort than drawing an equivalent flowchart
It can be easily modified.
Converting a pseudocode to a programming language is much easier than converting a flowchart to a programming language.
The disadvantages of pseudocode are listed below
It becomes difficult to understand the complex logic written in pseudocode.
When too many nested conditions are used in the pseudocode, the level of difficulty to understand the code increases.
In the case of pseudocode, a pictorial representation of program logic is not available.
Fill in the blanks
The instructions to the computer are given in the form of a ………..….. to carry out a specific task.
………..….. is a set of step by step instructions given in a logical order to solve a problem.
………..….. is a graphical representation of an algorithm.
………..….. box is used to show the steps involving comparison and decision making steps.
………..….. is an artificial and informal language that helps programmers develop algorithms.
State whether the following statements are True or False.
Algorithm consists of a standard set of symbols of different shapes which are connected by arrows.
The flowchart helps in the discussion of a solution with others or in explaining the program to others.
Decision box indicates any calculation or manipulation.
Connectors are used to connect the flowchart symbols.
Chapter 2 :Computer Overview
Definition of a Computer
The word Computer is derived from the word "compute" which means to calculate.
Computer is a device capable of accepting data in the form of facts and figures, manipulating them in a prescribed way, and supplying the results of these processes as meaningful information.
Program
Computer converts unarranged facts and figures (data) into meaningful information under the set of instructions called programs.
The computer performs the following functions:
Input: The process of entering data and instructions into the computer system.
Storing: Saving data and instructions to make them readily available for initial or additional processing, as and when required.
Processing:Performing arithmetic operations or logical operations on data.
Output:The process of producing useful information for the user.
Data and Information
The word data is the Latin plural of datum.
It denotes raw facts and figures that can be processed or manipulated by a computer.
It can be in any form - raw facts on paper or in electronic form.
It includes words, numbers, images and sound.
These facts and figures, when processed, become information.
Information is anything that holds some values for its receiver. Information is also referred to as processed data.
- Speed
- Accuracy
- Automation
- Storage
- Diligence
- Versatility
Speed
Speed of computer may be defined as the time taken by a computer to perform a task. It takes only a few seconds for the calculations that we take hours to solve.
2.Accuracy
The computers are the accurate machines that can perform a large number of tasks without errors, but if we feed wrong data to the computer it returns the same wrong information called GIGO (Garbage In Garbage Out).
3. Automation
Computer is an automatic machine which works without the intervention of the user. The user is required to give the data and utilize the result but the process is automatic.
4.Storage
Computer has a mass storage section where we can store a large volume of data for future use.
5.Versatility
Able to do two or more than two work at same time with same efficiency.
6.Diligence
Able to work for long period of time with same efficiency without getting tired.
GIGO (Garbage In Garbage Out).
If the input data are not correct, this may also lead to incorrect output. The computers follow the simple rule of GIGO (Garbage In Garbage Out).
Application of Computer
1. Education
2. Banking
3. E-commerce
4. Industry
5. Hospital
6. Cinema
7. Airport
8. Home
1. Education
-ICT is low cost solution for educating many skills to a large number of people in less time at their own pace.
-Using ICT both the teacher and students can save their time
-Online Education, Distant Learning, Online Examination etc are other purpose
2. Banking
-Banks are using ATMs for facilitating their customers to withdraw their amount.
-They can transfer their money to other accounts and can pay their utility bills online
3. E-commerce
-To buy and sell and exchange of products, services, and information using computer network
4. Industry
-Computers are used to manage business activities from shipment to distribution and advertising to selling their products
-to research about new products and raw materials
5. Hospital
-To keep record of medical and patient data
-medical imaging and equipment(used to control medical devices that perform CT Scans, ultrasounds, X-rays, MRIs, or blood tests.)
- patient monitoring
-research about new diseases and medicines
6. Cinema
-Put special effects in movies(animations)
-music(sound effects)
-editing
7. Home
-You can watch matches, movies, ceremonies and hear audio stuff .
-You can also download books, magazines, journals, newspapers, tutorials to learn skills.
-You can do text, voice and video chat using internet.
Airport
-To ensure that planes stay on schedule and that they fly safely
-Allows you to easily modify travel arrangements at any airport
-Computers are necessary for the use of pre- screening measures
-Computers are crucial to an airport's air traffic control services.
Limitations of a Computer
A computer cannot do anything unless they are first programmed with specific instructions.
Computer needs a proper environment for its working (i.e. fixed temperature and a dust free environment).
Computer is a machine which may break down any time. Interruption in electrical current may cause system components to malfunction resulting in the loss of valuable data.
Computer cannot take care of itself like a human.
Chapter 3: Types of Computer
Classification of Computer On the Basis of Work
The computer is an electronic device which accepts the input and processes them to give desired output. There are various types of computer available in the market. We can classify the computer as special purpose computers and general purpose computers. Special purpose computers are applicable for special area and have limited areas for application of temperature recording, speed measurement, telephone billing etc, but general purpose computers are the standard computers used for general application like word processing, spreadsheet, database application, internet access, program development etc.
Analog Computer
The computer that works with natural phenomena and physical values like earthquake measurement, speed of wind, weight light etc is known as Analog computers. It is especially used in scientific work, medical and industrial fields. These are special purpose computers. It measures physical values such as temperature or pressure that fall along a continuous scale in temperature or pressure. For example, you can see a system at petrol pumps that contains an analog processor and analog device that converts the flow of petrol into quantity. Speedometers in cars and your watch are other examples of an analog computer.
Features of Analog computer
It is specific to the particular task so we cannot use it for multiple applications.
It works on continuous data and gives continuous output.
It works in real time and has no storage capacity.
It gives output in the form of the graph, signals, table etc.
Digital Computer
A computer that works with digital value 0 and 1, where 0 is OFF and 1 is ON. It works with discrete data. Digital computer does not measure the continuous data for continuous output. Most of the electronic system is based on the digital system. Digital computers are very popular for actual computer works like preparation of the report, documentation, billing and other graphical work etc. The entire PC (Personal Computer) used today on different fields are digital computers.They are classified into two groups:
(i)Specific Purpose Digital Computer
Digital computers which are used to perform specific tasks are known as specific purpose digital computers. It only performs specific tasks.
(ii)General Purpose Computer
Digital computer which are used to perform general task is known as general purpose computer. It is used to perform various tasks.
Features of Digital computer
It works on the discontinuous or discrete data.
It is applicable for a general purpose so this is very versatile for an application.
It is based on the digits 0 and 1.
It is faster.
It has storage section also.
It is highly accurate and reliable than an analog system.
Hybrid computer
It is the combination of analog and digital computer systems. It works with continuous and discrete value. The good qualities of analog and digital computers are combined on this computer and made as the hybrid computer. These are used in ICU (Intensive Care Unit) of hospitals, jet planes, and other data analysis terminals. The hybrid computer transfers the data from analog to digital and digital to analog and vice-versa.
Features of hybrid computer
It is an expensive system.
It is designed for the special purpose so it is not versatile.
It works on discrete and continuous data.
It has limited storage.
It is more complex than other computer systems.
Classification of Computer Based on Configuration
Supercomputer
Supercomputer is the fastest, most expensive, big in size, and most powerful computer that can perform multiple tasks within a second. It has multi-user, multiprocessing, very high efficiency and large amount of storage capacity. It is called super computer because it can solve difficult and complex problem within a nano second. These computers are used to forecast the weather and global climates, digital film recording, etc.
Example
C-DAC (Center for Development of Advanced Computer) of India has developed the PARAM series of Super Computers. ANURAG is also Indian Super Computer. Other Supercomputers are CRAY XMP/14, CDC-205 etc. Mr. Seymour Cray was a pioneer in the field of supercomputer production. He had developed the first supercomputer Cray-1 in 1976.
Mainframe Computer
Mainframe Computer is the large sized computer that covers about 1000 sq feet. It is a general purpose computer that is designed to process large amounts of data with very high speed. It accepts large amounts of data from different terminals and multiple users and processes them at the same time. More than 100 users are allowed to work in this system. It is applicable for large organizations with multi-users for example: large business organization, department of examinations, industries and defense to process data of complex nature. It uses several CPUs for data processing. These computers are used for credit card processing, marketing, air traffic control systems etc.
Example
IBM S/390, IBM S/709, ICL 39, CDC 6600
Mini Computers
Mini Computers are medium sized computers. So, these are popular as middle ranged computers. It is also a multiple user computer and supports more than dozens of people at a time. It is costlier than a microcomputer.
It is also used in university, middle range business organizations to process complex data. It is also used in scientific research, instrumentation systems, engineering analysis, industrial process monitoring and control etc.
Example
MAI Basic 4, Data generation NOVA, Microdata Corp/Micro 820, PDP-11, VAX etc.
Microcomputer
Most popular general purpose computers which are mostly used on day to day work are microcomputers. These are popular as Home PC or Personal Computer (PC) because these are single user computers and mostly used for personal use and application. These support many higher level application costs and are easy in operation.
Example
IBM PCs, Apple Mac, IBM PS/2, All computers available with Pentium Models etc.
This comment has been removed by a blog administrator.
ReplyDeleteThis comment has been removed by a blog administrator.
ReplyDeleteyees
Deleteteacher can you please post answers of that algorithm one which you gave us homework
ReplyDelete