CH1. LOGIC/ALGORITHMS/PSEUDOCODE Flashcards

(67 cards)

1
Q

What do you mean by “logic”?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

what are the steps to design a logic?

A

steps to design logic are as follows:

  1. study the problem/think of all possible ways to solve the problem/select the most suitable method
  2. declare the variables (ask computer to make space for i/o.) ask user for i/o. accept i/o.
  3. decide conditions for procedure. decide logic in step by step format to execute the desired output.
  4. state the steps to computer
  5. execute the output
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

state the points to remember while deciding logic.

A
  1. every instruction should be in a clear/should have a simple meaning.
  2. the instruction should run for a fixed no. of times.
  3. each program should be executed one at a time.
  4. the program has to execute the perfect outcome.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

state whether the given sentence is right or wrong. correct the wrong ones:
1. c can run multiple instructions at a time.

A

wrong.

each program in C should be executed one at a time.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

state whether the given sentence is right or wrong. correct the wrong ones:
2. the program has to give the result which is accurate.

A

right

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

there are 3 ways of writing logic namely ______,_______and_________.

A

flowchart algorithm and pseudocode

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

what are the ways/methods to write logic?

A

There are 3 methods to write logic namely flowcharts, pseudocode and algorithms.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

what are flowcharts?

A

flowcharts is a step by step method of stating logic (steps to perform the task) via diagrams and symbols.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

what are algorithms?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

what is pseudocode?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what is the basic way to write logic?

A

The steps to write logic are as follows

  1. start
  2. print message for the user to enter input value
  3. declare variables
  4. accept variables
  5. state the process to computer (apply conditions to the process if needed)
  6. stop
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

The symbols in flowcharts are standarised by _______.

A

ANSI American national standard institute.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

what are the symbols used in flowcharts?

A

The symbols used in flowcharts are as follows:

  1. Terminal
  2. Input/output
  3. Process
  4. Decison box
  5. flowlines
  6. connectors
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

what are terminals? what is the use of terminal in flowchart?

A

Terminal in flowchart includes start and stop. it specifies start/stop of a process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what are I/O? what is the use of i/o in flowchart?

A

input/output are parallelogram shaped flowcharts. they are used to store input/output of process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

what is the use of process?

A

process is used when we state the tasks to the computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
17
Q

what is decision box? what is the role of decision box in flowchart?

A

decision box is an diamond shaped box which is used for conditional statements used in a process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

what are flowlines?

A

flowlines are arrowlike lines used to specify the chronology/sequence of the process.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

what are connectors?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
20
Q

what are the advantages/features of flowcharts?

A
  1. Powerful tool in programming
  2. Helps in development of logic with all possibilities.
  3. Is an pictorial representation of logic
  4. helps in execution of logic
  5. combination of flowchart is called a system
  6. results in strong documentation.
  7. helps in debugging
  8. easy to write for/using any language
  9. effective tool for checking process/logic.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

state whether the following is true/false. correct the false statements:
The ANSI standarized algorithms in logic.

A

false.

ansi (american national standarised institute) standarised flowchart symbols

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

state whether the following is true/false. correct the false statements:
algorithms uses English to write process/logic.

A

TRUE

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
23
Q

state whether the following is true/false. correct the false statements:
pseudo code specifies the programming terms

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

state whether the following is true/false. correct the false statements:
group of logic is called a system

A

true

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
state whether the following is true/false. correct the false statements: logic is used in documentation
false. | flowcharts are used in documentation
26
what is meant by Documentation?
Documentation is reviewing the data in a logic.
27
state whether the following is true/false. correct the false statements: Algorithms are useful in debugging
false. | Flowcharts are.
28
what is debugging?
removing an error from logic is called debugging. OR removing the flaws from the process...
29
what is dry run?
dry run is a trial program done to check all the possible methods of running the program/logic.
30
_________ flowcharts are used by programmers.
program
31
______ flowcharts plays an important role in documentation.
program
32
system programs are used by _____.
system analyst
33
list any two steps that are involved in problem solving
ANY 2 - Detailed study of the problem - Problem redefinition - Identification of input data, output requirements and conditions and limitations - Alternative methods of solution - Selection of the most suitable method - Preparation of a list of procedures and steps to obtain the solution - Generating the output
34
what do you mean by program flowchart? what does it include?
a program flowchart is an flowchart which has an emphasis of logic/programs. it shows the logic flow, program structure, operations performed.
35
state the characteristics of algorithms
each instructions must be precise and clear each instructions must eventually terminate the algorithm must give the desired output.
36
state the important points to remember while making a flowchart
the shape/symbol of flowchart must not be changed the flowchart size can be changed as required symbol of flowchart must be immediately recognizable the instructions inside flowchart must be clearly stated the flowlines must not cross
37
a pause in program is denoted by ____ symbol
terminal
38
there can be many terminal symbols in program
false
39
input/output symbol in flowchart denotes __ function
input output
40
process symbol represents ____ instructions
arithmetic and datamovement instructions
41
state the steps to write flowcharts /programming considerations for : computations
refer txtbook pg. 7
42
state the steps to write flowcharts/programming considerations for : decision making
refer txtbk pg 8
43
state the steps to write flowcharts/programming considerations for : loops
pg 10
44
state the steps to write flowcharts for : | predefined process
pg 12
45
MCQ: The result should be obtained in algorithm after ___ execution of steps (1st,finite,infinite)
Finite
46
MCQ: The instructions in algorithm should not repeat the instructions ____ (more than once,finitely,infinitely)
Infinitely
47
Mcq: Flowchart is symbolic step by step __ to task your program (plan,instructions,solution)
Solution
48
Flowcharts can be only developed for programs (true/false)
False. Flowcharts can be developed basically for any task
49
Flowcharts helps us detect any logical or other errors Before the program is been written.(t/f)
True
50
___ flowchart shows program structure, logic and operations performed
Program
51
Emphasis of ___ flowchart is on logic (system/program)
Program
52
Normally the process of developing program is as follows: 1. Flowchart,algorithm,pseudocode:program 2. Pseudocode,algorithm,flowchart:program 3. Algorithm,flowchart,pseudocode:program
3. Algorithm,flowchart,pseudocode:program. Txtbook pg 3
53
___ are independent of the language being used. (Logic, flowcharts, algorithms)
Flowcharts
54
Is the steps in right or wrong order: 1. Steps is developed (algorithm) 2. Logic (flowcharts) 3. Program (coding)
Right
55
If there are more than one process symbol they are: (being ignored and one process is executed at a time, gives error, placed in a sequence and are executed one after other sequentially)
Executed one after other sequentially
56
The correct order fpr executing flowchart is: (up-down, left-right, left-right and up to down)
From left to right and up to down
57
If the flowchart becomes complex __ is used (flowlines, connectors,/n)
Connectors
58
___can be working model of designing a new software system (logic, flowchart, algorithm)
Flowchart
59
``` Start Create memvars and read operations Get required data in memvars Do the required operations Print result Stop The following steps is for (loop, predefined, computations) ```
Computations
60
``` Start Initialise Execute required operations Increment Counter Stop The foll steps are for (loop, decision, compute) ```
Loop
61
For ___ situations, we make use of counters. (Looping, predefined, decision making)
Loop
62
If loops are repeated on the basis of condition __ is used to check the conditions (logical operators, conditional operators, relational operator)
Relational operator
63
In large application when we invoke livrary routine of a language, we are using ___ process. (Input/output, loop, predefined)
Predefined
64
Predefined process includes modular programming (true/false)
True. Pg 12
65
In ___ technique, we initialise memvars (decision,predefined,computation)
Computation. Pg 7
66
Branching to another set of commands in flowchart can be implemented by ___ (operators, functions, flowlines)
Functions. Pg 9
67
Variable loop is fixed loop (true/false)
True