Docsity

Procedure Programming(Pro102) asm1, Study notes of Information Technology

Toggle sidebar
bg1
1
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Prog102: Procedural Programming
Submission date
22/08/2021
Date Received 1st
submission
Re-submission Date
Date Received 2nd
submission
Student Name
Dang Nguyen Dang Khoi
Student ID
GCC200058
Class
GCC0903
Assessor name
Le Huynh Quoc Bao
Student declaration
I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand
that making a false declaration is a form of malpractice.
Student’s signature
Khoi
Grading grid
P2
P3
M1
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Procedure Programming(Pro102) asm1 and more Study notes Information Technology in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Prog 102 : Procedural Programming Submission date 22/08/2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Dang Nguyen Dang Khoi Student ID GCC

Class GCC0903 Assessor name Le Huynh Quoc Bao

Student declaration I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism. I understand that making a false declaration is a form of malpractice. Student’s signature Khoi

Grading grid P1 P2 P3 M1 M2 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

  • Assignment 1 Brief.......................................................................................
    • I. Scenario
    • II. Tasks
        1. Task
        1. Task
        1. Task
  • I. Provide an introduction to procedural programming
      1. General concepts
      • a. Introduction to computer programming languages
      • b. Introduction about procedural programming
      1. Characteristics and key features of procedural programming
      • a. Characteristics of procedural programming
      • b. Key features of procedural programming
  • implement a given design II. Identify the program units and data and file structures required to
    1. Identify the variables and data types required in the program
      1. A hierarchy diagram to illustrate the structure of program
  • III. Design procedural programming solution for problem ...........................
      1. A use case diagram for actions required
      1. Flowcharts of each small algorithm
      • a. Menu operation.......................................................................................................................
      • b. Enter student IDs, student’s grades ..........................................................................................
      • c. Print student ID and student’s grade ........................................................................................
      • d. Add student ID and student’s grade .........................................................................................
      • e. Delete student ID and student’s grade .....................................................................................
      • f. Find highest grade ....................................................................................................................
      • g. Find lowest grade ....................................................................................................................
      1. Advantages and disadvantages of flowchart
      • a. Advantages..............................................................................................................................
      • b. Disadvantages .........................................................................................................................
      1. Advantages and disadvantages of my flowchart
      • a. Advantages..............................................................................................................................
      • b. Disadvantages .........................................................................................................................
  • features of procedural programming .......................................................... IV. Evaluate the design of my solution against the characteristics and
      1. Advantages and disadvantages of procedural programming
      • a. Advantages..............................................................................................................................
      • b. Disadvantages .........................................................................................................................
      1. Advantages, disadvantages, and solution of my program
      • a. Advantages..............................................................................................................................
      • b. Disadvantages .........................................................................................................................
      • c. Solution to avoi disadvantages
  • V. The funtions can update for the program in the future ............................
  • References .................................................................................................

Assignment 1 Brief

I. Scenario

A math teacher wants to manage grades of a class. He asks you to help him to write a small application to do that. He needs to enter student IDs, student’s grades and store these information into 2 separate arrays (integer array for IDs and float array for grades). Then he needs to print all student IDs together with their grades. Finally, he needs to know which student has highest grade and lowest grade. Your program should be menu based with the options above. When an option is done, the program should go back to the main menu so he can choose another option. There should be an option to quit program.

II. Tasks

1. Task 1

To prove your programming ability to be appointed to this small project, please prepare an illustrated guide on programming in general and a particular emphasis on procedural programming. Here you will need to include introduction to computer programming languages and discuss key features of procedural programming.

2. Task 2

Your next task is to do the analysis for the scenario mentioned above by doing the following subtasks

  • Identify the variables and data types required in the program.
  • Identify and describe 2 different selection structures, including the condition(s) to check; state why they are needed and where they can be used in the context of the scenario.
  • Identify and describe any iteration constructs.
  • Split the program into functions (sub-functions) and draw a hierarchy diagram to illustrate the structure of your program.

3. Task 3

You need to use a drawing tool to draw design diagram for your program, includes:

  • A use case diagram for actions required
  • Flow chart diagrams for: menu operation, printing IDs and grades, finding max grade and finding min grade.
  • Review / evaluate your design, state clearly pros vs cons and which needs to improve, using characteristics of procedural programming as bases to discuss.

b. Key features of procedural programming

Predefined functions: A predefined function is typically an instruction identified by a name. Usually, the predefined functions are built into higher-level programming languages, but they are derived from the library or the registry, rather than the program. One example of a pre-defined function is ‘charAt()’, which searches for a character position in a string.  Local Variable: A local variable is a variable that is declared in the main structure of a method and is limited to the local scope it is given. The local variable can only be used in the method it is defined in, and if it were to be used outside the defined method, the code will cease to work.  Global Variable: A global variable is a variable which is declared outside every other function defined in the code. Due to this, global variables can be used in all functions, unlike a local variable.  Modularity: Modularity is when two dissimilar systems have two different tasks at hand but are grouped together to conclude a larger task first. Every group of systems then would have its own tasks finished one after the other until all tasks are complete.  Parameter Passing: Parameter Passing is a mechanism used to pass parameters to functions, subroutines or procedures. Parameter Passing can be done through ‘pass by value’, ‘pass by reference’, ‘pass by result’, ‘pass by value-result’ and ‘pass by the name’ (Bhatia, 2021).

II. Identify the program units and data and file structures required to

implement a given design

1. Identify the variables and data types required in the program

No. Variables Data types Describe

1 ID[] integer

The array used to store the ID of student with the data type is integer because it will help it easy storage in the array and help user easy receive information when it display in the screen of computer. 2 Grade[] float The array used to store the point of student with the data type is float because the point can be a decimal number.

3 Min float

The variables used to store and display lowest grade from the array with the data type is float because the lowest grade can be a decimal number.

4 Max float

The variables used to store and display highest grade from the array with the data type is float because the highest grade can be a decimal number.

2. Identify and describle 2 different selection structures

Name Structure General desciption Describe in

program

‘if’ Statements

if ( condition) { // one or more statements; } else { // one or more statements; }

If Statement is simply a set of operation which could be used to compare expressions. These generally have two values of LHS and RHS. This operator compares the expression of the left-hand side and right-hand side. In comparison, it simply returns a Boolean value (Pedamkar, 2019).

‘if’ Statement used when we find highest grade and lowest grade. It helps us compare and assign highest or lowest grade to variable.

3. Identify and describle any iteration constructs

Name Structure General desciption Describe in

program

For statement

for(initialization; condition; increment/ decrement) { // one or more statement; }

  • The initial value of the for loop is performed only once.
  • The condition is a Boolean expression that tests and compares the counter to a fixed value after each iteration, stopping the for loop when false is returned.
  • The incrementation/decrementation increases (or decreases) the counter by a set value (Guru99, 2021).

For statement is used to check condition, compare with a fixed value, and execute commands, for example: print, compare and assign value,… after each iteration. When the condition false, it will stop program.

4. A hierarchy diagram to illustrate the structure of program

2. Flowcharts of each small algorithm

a. Menu operation

b. Enter student IDs, student’s grades

d. Add student ID and student’s grade

e. Delete student ID and student’s grade

g. Find lowest grade

3. Advantages and disadvantages of flowchart

a. Advantages

 It is a convenient method of communication.  It indicates very clearly just what is being done, where a program has logical complexities.  A key to correct programming.  It is an important tool for planning and designing a new system.  It clearly indicates the role-played at each level.  It saves the inconveniences in future and serves the purpose of documentation for a system.  It provides an overview of the system and also demonstrates the relationship between various steps.  Facilitates troubleshooting.  It promotes logical accuracy.  It makes sure that no logical path is left incomplete without any action being taken (Tutsmaster, 2019).

b. Disadvantages

 The flowchart is a waste of time and slows down the process of software development.  The flowchart is quite costly to produce and difficult to use and manage.  Flowcharts are not meant for man to computer communication.  Sometimes the Complex logic of the program logic is quite complicated to draw out on by using different defined shapes. In that case, flowchart becomes complex and clumsy. This will become a pain for the user, resulting in a waste of time and money trying to correct the problem  If you need to modify or alternate the process then it will be very hard to do in the flowchart. Because either you will have to erase the end of the flowchart or start (Tutsmaster, 2019).

4. Advantages and disadvantages of my flowchart

a. Advantages

 It helps us have an overview of each task of the program.  It helps coders easier, faster and make less mistakes when they code. For example, false algorithm, condition, miss program tasks.  The roles of each level are clearly divided.  We can easy fix program when it errored.