CH1. LOGIC/ALGORITHMS/PSEUDOCODE Flashcards

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
Q

state whether the following is true/false. correct the false statements:
logic is used in documentation

A

false.

flowcharts are used in documentation

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

what is meant by Documentation?

A

Documentation is reviewing the data in a logic.

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

state whether the following is true/false. correct the false statements:
Algorithms are useful in debugging

A

false.

Flowcharts are.

28
Q

what is debugging?

A

removing an error from logic is called debugging.
OR
removing the flaws from the process…

29
Q

what is dry run?

A

dry run is a trial program done to check all the possible methods of running the program/logic.

30
Q

_________ flowcharts are used by programmers.

A

program

31
Q

______ flowcharts plays an important role in documentation.

A

program

32
Q

system programs are used by _____.

A

system analyst

33
Q

list any two steps that are involved in problem solving

A

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
Q

what do you mean by program flowchart? what does it include?

A

a program flowchart is an flowchart which has an emphasis of logic/programs. it shows the logic flow, program structure, operations performed.

35
Q

state the characteristics of algorithms

A

each instructions must be precise and clear
each instructions must eventually terminate
the algorithm must give the desired output.

36
Q

state the important points to remember while making a flowchart

A

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
Q

a pause in program is denoted by ____ symbol

A

terminal

38
Q

there can be many terminal symbols in program

A

false

39
Q

input/output symbol in flowchart denotes __ function

A

input output

40
Q

process symbol represents ____ instructions

A

arithmetic and datamovement instructions

41
Q

state the steps to write flowcharts /programming considerations for :
computations

A

refer txtbook pg. 7

42
Q

state the steps to write flowcharts/programming considerations for :
decision making

A

refer txtbk pg 8

43
Q

state the steps to write flowcharts/programming considerations for :
loops

A

pg 10

44
Q

state the steps to write flowcharts for :

predefined process

A

pg 12

45
Q

MCQ: The result should be obtained in algorithm after ___ execution of steps (1st,finite,infinite)

A

Finite

46
Q

MCQ: The instructions in algorithm should not repeat the instructions ____ (more than once,finitely,infinitely)

A

Infinitely

47
Q

Mcq: Flowchart is symbolic step by step __ to task your program (plan,instructions,solution)

A

Solution

48
Q

Flowcharts can be only developed for programs (true/false)

A

False. Flowcharts can be developed basically for any task

49
Q

Flowcharts helps us detect any logical or other errors Before the program is been written.(t/f)

A

True

50
Q

___ flowchart shows program structure, logic and operations performed

A

Program

51
Q

Emphasis of ___ flowchart is on logic (system/program)

A

Program

52
Q

Normally the process of developing program is as follows:

  1. Flowchart,algorithm,pseudocode:program
  2. Pseudocode,algorithm,flowchart:program
  3. Algorithm,flowchart,pseudocode:program
A
  1. Algorithm,flowchart,pseudocode:program. Txtbook pg 3
53
Q

___ are independent of the language being used. (Logic, flowcharts, algorithms)

A

Flowcharts

54
Q

Is the steps in right or wrong order:

  1. Steps is developed (algorithm)
  2. Logic (flowcharts)
  3. Program (coding)
A

Right

55
Q

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)

A

Executed one after other sequentially

56
Q

The correct order fpr executing flowchart is: (up-down, left-right, left-right and up to down)

A

From left to right and up to down

57
Q

If the flowchart becomes complex __ is used (flowlines, connectors,/n)

A

Connectors

58
Q

___can be working model of designing a new software system (logic, flowchart, algorithm)

A

Flowchart

59
Q
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)
A

Computations

60
Q
Start
Initialise
Execute required operations
Increment Counter
Stop
The foll steps are for (loop, decision, compute)
A

Loop

61
Q

For ___ situations, we make use of counters. (Looping, predefined, decision making)

A

Loop

62
Q

If loops are repeated on the basis of condition __ is used to check the conditions (logical operators, conditional operators, relational operator)

A

Relational operator

63
Q

In large application when we invoke livrary routine of a language, we are using ___ process. (Input/output, loop, predefined)

A

Predefined

64
Q

Predefined process includes modular programming (true/false)

A

True. Pg 12

65
Q

In ___ technique, we initialise memvars (decision,predefined,computation)

A

Computation. Pg 7

66
Q

Branching to another set of commands in flowchart can be implemented by ___ (operators, functions, flowlines)

A

Functions. Pg 9

67
Q

Variable loop is fixed loop (true/false)

A

True