CH1. LOGIC/ALGORITHMS/PSEUDOCODE Flashcards
What do you mean by “logic”?
Logic is the procedure/process used by computer to solve users problems/to perform users tasks in the most suitable way.
OR
Logic is the most suitable procedure used by computers to get the precise outcomes of the tasks given by the users.
OR
The procedure used by programmers for computers to solve users problem solving tasks is termed as logic.
what are the steps to design a logic?
steps to design logic are as follows:
- study the problem/think of all possible ways to solve the problem/select the most suitable method
- declare the variables (ask computer to make space for i/o.) ask user for i/o. accept i/o.
- decide conditions for procedure. decide logic in step by step format to execute the desired output.
- state the steps to computer
- execute the output
state the points to remember while deciding logic.
- every instruction should be in a clear/should have a simple meaning.
- the instruction should run for a fixed no. of times.
- each program should be executed one at a time.
- the program has to execute the perfect outcome.
state whether the given sentence is right or wrong. correct the wrong ones:
1. c can run multiple instructions at a time.
wrong.
each program in C should be executed one at a time.
state whether the given sentence is right or wrong. correct the wrong ones:
2. the program has to give the result which is accurate.
right
there are 3 ways of writing logic namely ______,_______and_________.
flowchart algorithm and pseudocode
what are the ways/methods to write logic?
There are 3 methods to write logic namely flowcharts, pseudocode and algorithms.
what are flowcharts?
flowcharts is a step by step method of stating logic (steps to perform the task) via diagrams and symbols.
what are algorithms?
Algorithms is a method of writing logic via words ie by specifying the steps of a procedure in sentence format. real world example of algorithms are RECIPE.
what is pseudocode?
plain language description of steps to the computer. it includes writing programming descriptions/terms like conditions, operators, functions etc alike algorithms.
OR
Method of writing logic by sequence of instructions that includes programming descriptions.
what is the basic way to write logic?
The steps to write logic are as follows
- start
- print message for the user to enter input value
- declare variables
- accept variables
- state the process to computer (apply conditions to the process if needed)
- stop
The symbols in flowcharts are standarised by _______.
ANSI American national standard institute.
what are the symbols used in flowcharts?
The symbols used in flowcharts are as follows:
- Terminal
- Input/output
- Process
- Decison box
- flowlines
- connectors
what are terminals? what is the use of terminal in flowchart?
Terminal in flowchart includes start and stop. it specifies start/stop of a process.
what are I/O? what is the use of i/o in flowchart?
input/output are parallelogram shaped flowcharts. they are used to store input/output of process.
what is the use of process?
process is used when we state the tasks to the computer.
what is decision box? what is the role of decision box in flowchart?
decision box is an diamond shaped box which is used for conditional statements used in a process.
what are flowlines?
flowlines are arrowlike lines used to specify the chronology/sequence of the process.
what are connectors?
connectors are used to connect the flowchart when the flowcharts become complex or when the space/page is over. used for the purpose of convienence and clarity
what are the advantages/features of flowcharts?
- Powerful tool in programming
- Helps in development of logic with all possibilities.
- Is an pictorial representation of logic
- helps in execution of logic
- combination of flowchart is called a system
- results in strong documentation.
- helps in debugging
- easy to write for/using any language
- effective tool for checking process/logic.
state whether the following is true/false. correct the false statements:
The ANSI standarized algorithms in logic.
false.
ansi (american national standarised institute) standarised flowchart symbols
state whether the following is true/false. correct the false statements:
algorithms uses English to write process/logic.
TRUE
state whether the following is true/false. correct the false statements:
pseudo code specifies the programming terms
true
state whether the following is true/false. correct the false statements:
group of logic is called a system
true
state whether the following is true/false. correct the false statements:
logic is used in documentation
false.
flowcharts are used in documentation
what is meant by Documentation?
Documentation is reviewing the data in a logic.