Docsity

Procedural Programming in Computing, Assignments of Web Design and Development

Partial preview of the text

Download Procedural Programming in Computing and more Assignments Web Design and Development in PDF only on Docsity!

Higher Nationals in Computing

Unit 0: Procedural Programming

ASSIGNMENT 1

Learner’s name: Nguyễn Thành Thông

ID: GCS

Class: GCS1005A

Subject code: PROG

Assessor name: PHAN MINH TAM

Assignment due: Assignment submitted:

❒ Summative Feedback: ❒ Resubmission Feedback:

Grade: Assessor Signature: Date:

Signature & Date:

ASSIGNMENT 1 BRIEF Unit Number and Title Unit 0: IT Fundamental & Procedural Programming Academic Year 2021 Unit Tutor Assignment Title Assignment 1: Analysis and Design a solution for procedural programming problem Issue Date Submission Date IV Name & Date Learning Outcomes and Assessment Criteria Pass Merit Distinction LO1 Understand the principles of procedural programming LO2 Be able to design procedural programming solutions P1 Provide an introduction to procedural programming M1 Discuss on characteristics and features of procedural programming D1 Critically evaluate the design of your solution against the characteristics and features of procedural programming. P2 Identify the program units and data and file structures required to implement a given design M2 Review the design of a procedural programming solution. P3. Design a procedural programming solution for a given problem Assignment Brief 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

Table of Contents

1. Introduction to computer programming languages 1.1 Definition

  • A programming language is a form of computer language that is used to write software, scripts, or instructions for the computer to follow. Programming languages are one kind of computer language and are used in computer programming to implement algorithms. Example: C, C++, C#, Java, JavaScript, Python, HTML, Pascal, etc P a g e | 2

1.2 High level programming

  • A high-level programming language is a programming language with strong abstraction from the details of the computer. In contrast to low-level programming languages, it may use natural language elements , be easier to use, or may automate (or even hide entirely) significant areas of computing systems (e.g. memory management), making the process of developing a program simpler and more understandable than when using a lower-level language. The amount of abstraction provided defines how "high-level" a programming language is. P a g e | 3

1.1 Definition

- Procedural programming is a programming paradigm, derived from imperative programming,[1]^ based on the concept of the procedure call. Procedures (a type of routine or subroutine) simply contain a series of computational steps to be carried out. Any given procedure might be called at any point during a program's execution, including by other procedures or itself.

2. 2 Introduction to C programming language

  • C is a general-purpose programming language created by Dennis Ritchie at the Bell Laboratories

in 1972. It is a very popular language, despite being old. C is strongly associated with UNIX, as it

was developed to write the UNIX operating system.

P a g e | 5

3. Criteria to select a programming language to use

  • No single language is the best choice for any given project. Although preference might be given to certain factors like performance, security in enterprise applications, fewer lines of code among other factors. For personal projects, the selection of a programming language may be as simple as picking a personal favorite. The right selection of a programming language yields solutions that are concise, easy to debug, easy to extend, easy to document, and easy to fix.
  • Type of application. Web applications, mobile applications, embedded firmware, etc.... P2. Identify the program units and data and file structures required to implement a **given design
  1. Variables**

1.1 Definition

  • Variable is basically nothing but the name of a memory location that we use for storing data. We

can change the value of a variable in C or any other language, and we can also reuse it multiple

times

1 .2 Rules for naming a variable...........................................................................................................................................

  • A variable name can only have letters (both uppercase and lowercase letters), digits and underscore.

The first letter of a variable should be either a letter or an underscore.

P a g e | 6

3. Selection structures (Conditional Statements)

3 .1 If statement...................................................................................................................................................................

3 .1.1 Syntax

Syntax

If ( Condition )

Block of statements;

Execution flow diagram

3.1.2 Example:

3 .2 If .. else

3 .2.1 Syntax

P a g e | 8

3 .2.2 Example

P a g e | 9

3 .3 If .. else if P a g e | 11

3 .4 Switch case

4. Iteration structures

4 .1 For statement................................................................................................................................................................

4 .1.1 Syntax

P a g e | 12