Pseudocode and flowchart Questions and answers PDF

Question 1:

  • Write a program algorithm that would enable the user to enter student marks. The program should then determine whether the mark entered is a pass or fail given that the pass mark is 50

Answer
START 
                Print “enter student marks”
                Read student marks
                                IF marks<50 THEN
                Print “Fail”
                                ELSE
                Print “Pass”
                               END IF
STOP

Explanations

  • Marks is an input entity. therefore in the Print keyword, the user is prompted to enter marks parameter e.g 60 and in the Read Keyword, the computer operating system is instructed to set aside a memory to store marks parameters that have been input
  • IF...THEN...ELSE Selection structure has been used because there are two options to be considered thus Pass and Fail.

      General format is:
          IF THEN
               statement;
          ELSE
               statement;
          ENDIF

  • Start and Stop keywords have been used to begin and end the pseudocode script respectively

Question:

  • Draw a flowchart to match the above pseudocode

Answer

Pseudocode and flowchart Questions and answers PDF




Pseudocode and flowchart Questions and answers PDF

Pseudocode and flowchart Questions and answers PDF

Numerical methods are techniques by which mathematical problems are formulated so that they can be solved with arithmetic operations. Although there are many kinds of numerical methods, they have one common characteristic: they invariably involve large numbers of tedious arithmetic calculations. It is little wonder that with the development of fast, effi cient digital computers, the role of numerical methods in engineering problem solving has increased dramatically in recent years. PT1.1.1 Noncomputer Methods Beyond providing increased computational fi repower, the widespread availability of computers (especially personal computers) and their partnership with numerical methods has had a signifi cant infl uence on the actual engineering problem-solving process. In the precomputer era there were generally three different ways in which engineers approached problem solving: 1. Solutions were derived for some problems using analytical, or exact, methods. These solutions were often useful and provided excellent insight into the behavior of some systems. However, analytical solutions can be derived for only a limited class of problems. These include those that can be approximated with linear models and those that have simple geometry and low dimensionality. Consequently, analytical solutions are of limited practical value because most real problems are nonlinear and involve complex shapes and processes. 2. Graphical solutions were used to characterize the behavior of systems. These graphical solutions usually took the form of plots or nomographs. Although graphical techniques can often be used to solve complex problems, the results are not very precise. Furthermore, graphical solutions (without the aid of computers) are extremely tedious and awkward to implement. Finally, graphical techniques are often limited to problems that can be described using three or fewer dimensions. 3. Calculators and slide rules were used to implement numerical methods manually. Although in theory such approaches should be perfectly adequate for solving complex problems, in actuality several diffi culties are encountered. Manual calculations are slow and tedious. Furthermore, consistent results are elusive because of simple blunders that arise when numerous manual tasks are performed. During the precomputer era, signifi cant amounts of energy were expended on the solution technique itself, rather than on problem defi nition and interpretation (Fig. PT1.1a). This unfortunate situation existed because so much time and drudgery were required to obtain numerical answers using precomputer techniques. MODELING, COMPUTERS, AND ERROR ANALYSIS

How do you write a pseudocode for a flowchart?

This is assisted by the use of pseudocode and program flowcharts..
Enter Limit..
Set Number = 0..
Set Sum = 0..
Repeat the following: a. If Sum > Limit, terminate the repitition, otherwise. b. Increment Number by one. c. Add Number to Sum and set equal to Sum..
Print Number and Sum..

What are the 5 Rules of pseudocode?

Write only one stmt per line. Each stmt in your pseudocode should express just one action for the computer. ... .
Capitalize initial keyword. In the example above, READ and WRITE are in caps..
Indent to show hierarchy. ... .
End multiline structures. ... .
Keep stmts language independent..

What is pseudo code PDF?

Pseudo code is a simple way of writing programming code in English. Pseudo code is simply an implementation of an algorithm in the form of annotations and informative text written in plain English. Pseudo code is not actual programming language. It has no syntax like any of the programming language and thus can't.

What is a flowchart question answer?

The flowchart is a diagram which visually presents the flow of data through processing systems. This means by seeing a flow chart one can know the operations performed and the sequence of these operations in a system. Algorithms are nothing but sequence of steps for solving problems.