1. Trang chủ
  2. » Luận Văn - Báo Cáo

btec level 5 hnd diploma in computing prog102 procedural programming

22 0 0
Tài liệu đã được kiểm tra trùng lặp

Đang tải... (xem toàn văn)

Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống

THÔNG TIN TÀI LIỆU

Thông tin cơ bản

Tiêu đề BTEC Level 5 HND Diploma in Computing Prog102: Procedural Programming
Tác giả Trần Tiến Văn
Người hướng dẫn Phạm Danh Tuyên
Trường học Greenwich University
Chuyên ngành Computing
Thể loại Assignment
Định dạng
Số trang 22
Dung lượng 605,88 KB

Nội dung

List data types, data structures needed in the problem………10 b.. Usually, the predefined functions are built into higher-level programming languages, but they are derived from the library

Trang 3

ASSIGNMENT 1 FRONT SHEET

Unit number and title Prog102: Procedural Programming

Student declaration

I certify that the assignment submission is entirely my own work and I fully understand the consequences of plagiarism I understand thatmaking a false declaration is a form of malpractice

Student’s signature Grading grid

Trang 5

Summative Feedback: Resubmission Feedback:

Lecturer Signature:

Trang 7

Table of Contents

Table of Figures .3

1.Introduction to computer programming languages 4

a Introduction about an introduction to procedural programming………8

b.Problems statement 9

2 Analysis 10

a List data types, data structures needed in the problem………10

b Conditional statements needed in the problem 11

c Loop statement needed in the problem 11

3 Design 11

a WBS: A WBS to breakdown a probleminto small ones Explain the WBS 11

b.While iteration structure 12

c Flowcharts: Flowcharts of each small algorithm and explaination Review flowcharts, discuss alternative solution if possible………

4 Evaluation 13

a Evaluate your solution ( ananlysis, wbs, flowcharts) 13

b Evaluate how procedural progamming is applied to your problem ( advantages, disadvantages, difficulties) 14

Document shared on www.docsity.com Downloaded by: tran-tien-van-fgw-hn

Trang 9

1.a Introduction about procedural progamming

The procedural programming method is the implementation of the above function-oriented approach The procedural approach divides a large program (function) into blocks of functions or functions (procedures) that are small enough to be easy to program and test Each function has a start and an end point and has its own data and logic In a program system, variables have certain visible scopes In a program, functions work independently of each other Data is converted back and forth through function call parameters Dividing a program into functions allows multiple people to participate in the program's construction Each person constructs one or more independent functions

- 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

Trang 10

+ 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

Trang 11

+ 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’

1.1 Problem statement

There are number of bussiness problem, from simple to very complicated For example,

it is very hard to manage all staffs and know if your staff hard working Therefore, making a small application can help us to indicate who hit hard target in that month If they have harded full 30 days, they will get bonusmore

Trang 13

Explain image of making an application to resolve bussiness problem.

- Simply put, procedural progamming involves writing down a list of intructions to tell the computer what it should do step-by-step to finish the task at hand

2 Analyse the problem and explain.

- List data types, data structures needed in the problem:

In C programming, data types are just the same what their name suggests They represent the kind of data to store They are used to declare several functions as well as variables in aprogram There are mainly three categories of data types: Basic/Primitive(nguyên thuỷ), Derived( có nguồn gốc), User-Defined ( người dùng xác định)

Trang 14

In this program I mainly use Basic and Derived types in order to compete my work:

Trang 15

 Type data Integer with variable n:

Input exactly a number of students I want to manage

 Types data Integer with variable i:

Declare and initialize variables for controlling loop

 Type data Integer with variable Key:

Select options from the menu and input with variable key allow me to select options from the menu (input student’s information, show all student’s information, find the highest/lowest grade or exit the program)

 Type data Integer array with variable ID[]:

Input student’s ID and store it

 Type data Float array with variable Grade[]:

Input the student’s grades and store it

Trang 17

This image Variables and data types needed for this problem.

Conditional statements needed in the problem:

Conditional Statement in C programming are used to make decisions based on the conditions

In this project, conditional statements help me to find the highest and the lowest grade of all students Located in Function named Max and Function named Min

Loop statement needed in the problem:

Looping Statements in C execute the sequence of statements many times until the stated

condition becomes false A loop in C consists of two parts, a body of a loop and a control statement The control statement is a combination of some conditions that direct the body of the loop to execute until the specified condition becomes false

Trang 18

p p

3.1 Design(P3,M2)

Trang 19

Work breakdown structure.

Trang 20

Explain: Wbs is very useful with the feature of helping me to separate problem into small ones, which make my project more manageable (quản lý) and approachable (tiếp cận) I know that using this WBS can response the demand of the scenario easily

A each WBS , the level 1 has five Elements

1 Provide administrator rights ( input student’s information)

2 Display all student’s information ( IDs, grades)

3 Find the highest grade ( by comparing each student’s grades)

4 Find the lowest grade ( by comparing each student’s grades)

5 Exit the program

Trích nguồn:

Trang 21

%E1%BB%A5c

https://hackr.io/blog/procedural-programming#:~:text=Procedural%20Programming

%20may%20be%20the,procedures%20as%20two%20different%20entities

Ngày đăng: 09/05/2024, 14:14