Problem solving and program design Flashcards

1
Q

What are the steps in problem solving

A

1) Define the problem
2) Propose suggestions and evaluate them to get the right solution
3) Determine the most efficient solution
4) Develop the algorithm
5) Test and validate the solution

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

a solution is …

A

a set of instructions that,
if followed in order
will produce the required information

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

What is an efficient solution?

A

An efficient solution is one that uses the least effort to get the most benefits.

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

In defining the solution, you must define … /what are the normal components of a computer solution

A

1) input - what info will be input
2) how info will be processed
3) output - what results will be output
4) info that needs to be stored (during the process, or to be kept for another time)

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

The divide-and-conquer approach is …

A

to repeatedly split a large problem into a number of smaller sub-problems
until a solution is identified

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

A computer program is …

A

a series of coded instructions for the computer

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

What is an algorithm?

A

An algorithm is
a sequence of instructions
that has a finite number of steps that if followed
produces a precise solution to the given problem

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

An algorithm must set out (3 responses)

A

An algorithm must set out
1) instructions - what actions to take
2) sequence - in what order
3) when to stop

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

2 types of algorithms

A

flowcharts
pseudocode

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

Pseudocode is …

A

a formal way of writing an algorithm
using English text, numbers and special characters
a language that resembles or models real programming language
a kind of structured English for describing algorithms

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

Flowchart is …

A

Diagrams that visually represent the series of instructions of algorithm

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

Difference between flowchart and pseudocode

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

Algorithms can be written using … (2 responses)

A

flowcharts and pseudocode

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

Algorithms, pseudocode and computer programs are written using __________ _____________ and ______________

A

Algorithms, pseudocode and computer programs are written using specific rules and statements

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

Computer programs are written in different ___________ __________

A

Computer programs are written in different computer languages

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

What are the steps in developing an algorithm

A

1) Define the problem
2) Analyze the solution
3) Develop an algorithm/method of
solving the problem
4) Write the pseudocode or flowchart corresponding to the algorithm
5) Test and validate the program
6) Document the program

17
Q

What is a command?

A

A command is a word
that instructs a computer
what must be done
in order to accomplish a specific task

18
Q

Commands are specific to

A

Commands are specific to a particular programming language
Every programming language has its own specific commands

19
Q

Name 2 programming languages

A

Python
Pascal

20
Q

Examples of commands - 4 responses

A

write
print
read
input

21
Q

A construct is …. Give an example.

A

A construct is a group of instructions that work together with commands to accomplish a specific task.
An example is IF … THEN construct

22
Q

Problem statement that what needs to be done

A
23
Q

Problem statements that what is required for output

A
24
Q

What are variables?

A
25
Q

What can you store in a variable?

A
26
Q

When write a program, you will write instructions to : (2 responses)

A

When write a program, you will write instructions to :
1) declare the variable - give it a name
2) Allow a value to be assigned to the variable

27
Q

Declaring a variable means …

A

1) Giving the variable a name
2) saying what type of data it will store - data type

28
Q

Rules in naming variables:

A
  • short simple names
  • meaningful name that remind of purpose of the variable
  • must begin with a letter, not number
  • no spaces
  • example Age, FirstName, Cost
29
Q

What are the 5 main data types in variables

A

1) Boolean or logic
2) Integer
3) Real number
4) Character
5) String

30
Q

Boolean or logic data type can only store _______ or _________

A

Boolean or logic data type can only store
true or false, yes/no

31
Q

Integer data type can only store __________

A

Integer data type can only store
whole numbers
no fractions or decimals

32
Q
A