Procedural Programming ASM 1, Assignments of Product Development

defining Procedural Programing,... analysis of variables, data type, structure and usage,.. Design: Use-case Diagram, FlowChart,... References

Typology: Assignments

2020/2021

Uploaded on 02/25/2021

trungdv123
trungdv123 šŸ‡»šŸ‡³

4.5

(4)

3 documents

1 / 16

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 0: Procedural Programming
Submission date
17/10/2020
Date Received 1st
submission
17/10/2020
Re-submission Date
21/10/2020
Date Received 2nd
submission
21/10/2020
Student Name
Le Trong Trung
Student ID
GCH190392
Class
GCH0902
Assessor name
Nguyen Dinh Tran Long
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
Trung
Grading grid
P1
P2
P3
M1
M2
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Procedural Programming ASM 1 and more Assignments Product Development in PDF only on Docsity!

ASSIGNMENT 1 FRONT SHEET

Qualification BTEC Level 5 HND Diploma in Computing

Unit number and title Unit 0 : Procedural Programming

Submission date 17/10/2020 Date Received 1st submission 17/10/

Re-submission Date 21/10/2020 Date Received 2nd submission 21/10/

Student Name Le Trong Trung Student ID GCH

Class GCH0902 Assessor name Nguyen Dinh Tran Long

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 Trung

Grading grid

P1 P2 P3 M1 M2 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date:

Lecturer Signature:

I. Introduction to Procedural Programming

1. Introduction and presentation about programming language

  • Programming language is a standardized language according to a system of separate rules, so that programmers can describe working programs for electronic devices but also for humans and those devices understand it. (NguyenTinh, 2020)
  • The vocabulary of computer only includes 1 and 0 (binary).

2. Introduce and go into depth on procedural programming

  • writing a program that the computer can do to solve a given problem This process includes: analyzing the problem, finding the solution, write a program (describe the algorithm according to a selected programming language), try the program on the computer and fix errors until it runs smoothly on the computer, meeting the requirements set out.
  • The procedural programming method is the way to implement the function-oriented method above. The procedural method divides a large program (function) into functional blocks or functions (procedures) that are small enough to be easily programmed and tested. Each function has a starting point and an end point and has its own data and logic.
  • In a programming system, variables have certain visibility ranges. In the program, functions work independently of each other. Data is passed back and forth through function call parameters. Dividing the program into functions allows more people to participate in building the program. Each person constructs one or several independent functions. (Khoa, 2020) Figure 1 .Programming Language.

3. For examples (code) for programming languages:

  • Program to Display ā€œHello World…!ā€. Figure 3 .Display "Hello World...!" Output: Figure 2. Procedural Programming Example

II. Analysis of variables, data types, structure and usage

1. Variables and data types.

  • Variables & Datatypes
  • int choices(int choice reports option that users choose)
  • int N = 100 ( the maxium student input in program)
  • int current = 0(the values number of student current = 0)
  • int IDs (ID of student)
  • float grades[](the grades of student)
  • float max(the highest grades of student)
  • float min(the lowest grades of student) 2. Structures.
  • Switch statement function:
  • Used in situations where the expression being evaluated results in multiple values. And in my report, I use it to declare different options which users choose to report and use in ā€œMenu optionsā€. In my program there will be a menu with 4 options: 1. Input ID and Grade student, 2. Print all information of the current student,
    1. The highest and lowest grades, 4. Exit the program.
  • If I wanted to find the person with the highest and lowest grades, then I would choose 3, after finding the result, I can choose 1 to enter the new Id and grades, or I can choose 4 and finish the program
  • With this multi-function program, I will have more options for storing and retrieving student information and it helps to achieve high efficiency in no time as compared to other popular programs. Figure 6 .Variables & Datatypes in program.

Figure 7 .Source code Menu program

  • ā€œIfā€ statement function:
  • Allows us to make a decision in the programs. Allow programs to test certain condition and

make decision about which code block to be executed.

In my program, ā€œifā€ statement is used for finding the highest or the lowest grades in memory that

users input.

  • If the smallest variable returns the value (min), the largest returns the value (max).
    • Switch..case
    • The switch case statement is a control & branch structure that can be completely replaced by an if else structure. However, using switch cases will make our code easier to write and read; Another thing is that using a switch case seems to give better performance than using if else. (Hieu, 2020) Figure 8. source code find max,min grades in program
    • The do…while loop.
    • The do… while loop is quite similar to the while loop. However, it has 1 difference that the do ... while loop will run the loop body at least 1 time whether the condition is true or false. Because the do… while loop checks for the loop condition after doing the job. (Hieu, 2020) 3. Hierarchy diagram.

III. Design

  1. Use-case diagram Diagram 1. Used case Diagram

2. Flowchart Diagram 2. Menu Based

  • Opiton Display
    • Eplain flow chart:
    • Step 1: START.
    • Step 2: Set float grade[15], ID[15],n,n=0.
    • Step 3: check the condition.
      • if true, Go To step 4.
      • if false Go To step 7.
    • Step 4: Print the ID, Grades.
    • Step 5: ICREMENT I by 1.
    • Step 6: Repeat step 3.
    • Step 7: Next Opition.
    • Step 8: Stop. Diagram 4. Student ID & Student Grades.
  • Find highest grades Diagram 5. Highest Grades

IV. References kamleshbhalui, 2020. GeeksforGeeks. [Online] Available at: https://www.geeksforgeeks.org/maximum-and-minimum-in-an-array/ [Accessed 17 10 2020]. Bhumika_Rani, 2020. GeeksforGeeks. [Online] Available at: https://www.geeksforgeeks.org/introduction-of-programming-paradigms/ [Accessed 17 10 2020]. Hieu, N. V., 2020. laptrinhkhongkho. [Online] Available at: https://nguyenvanhieu.vn/lenh-switch-case-trong-c/ [Accessed 21 10 2020]. Hieu, V., 2020. LapTrinhKhongKho. [Online] Available at: https://nguyenvanhieu.vn/kieu-du-lieu-trong-c/ [Accessed 17 10 2020]. Khoa, 2020. voer. [Online] Available at: https://voer.edu.vn/c/cac-phuong-phap-lap-trinh/79497160/ec39e [Accessed 17 10 2020]. NguyenTinh, 2020. hocban.vn. [Online] Available at: https://hocban.vn/ngon-ngu-lap-trinh-la- gi#:~:text=Ng%C3%B4n%20ng%E1%BB%AF%20l%E1%BA%ADp%20tr%C3%ACnh%20(programming,b%E1%BB%8B %20%C4%91%C3%B3%20%C4%91%E1%BB%81u%20hi%E1%BB%83u%20%C4%91%C6%B0%E1%BB%A3c. [Accessed 17 10 2020]. Souvik, 2020. Souvik. [Online] Available at: https://medium.com/@9749866865s/c-programming-58cc67e1df [Accessed 17 10 2020]. Souvik, n.d. Souvik. [Online]. viettuts, 2020. viettuts. [Online] Available at: https://viettuts.vn/lap-trinh-c/bien-trong-c [Accessed 17 10 2020].