0% found this document useful (0 votes)
51 views9 pages

C Language #1

The document discusses computer programming languages and procedural programming. It defines computer programming languages and lists some popular languages like Java, Python, and JavaScript. It then defines procedural programming as breaking a program into smaller procedures or functions. The key features of procedural programming include predefined functions, local and global variables, modularity, and parameter passing. Advantages include reusability and ease of implementation while disadvantages include difficulty writing and reusing code. The document then provides examples of coding structures like data types, selection statements, iteration constructs, and functions needed to analyze student grades and IDs. It includes use case and flowchart diagrams to illustrate the program structure and flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views9 pages

C Language #1

The document discusses computer programming languages and procedural programming. It defines computer programming languages and lists some popular languages like Java, Python, and JavaScript. It then defines procedural programming as breaking a program into smaller procedures or functions. The key features of procedural programming include predefined functions, local and global variables, modularity, and parameter passing. Advantages include reusability and ease of implementation while disadvantages include difficulty writing and reusing code. The document then provides examples of coding structures like data types, selection statements, iteration constructs, and functions needed to analyze student grades and IDs. It includes use case and flowchart diagrams to illustrate the program structure and flow.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

I.

TASK 1
A. Computer programming language
1. Computer programming language definition
Computer programming languages are like human languages, there are many types of
programming languages that programmers can use to communicate with computers and each
language has its own characteristics but also many similarities between programming languages.
The programming language makes it possible to give instructions to the computer in a language
that the computer understands, it also helps to quickly and effectively process large and complex
information flows. (Anon., n.d.)

2. Popular programming languages


There are many different programming languages in the world, but there are only a few popular
and widely used programming languages: (khushipuri37, n.d.)

• C
• C++
• C#
• Objective-C

• Java
• Scala
• Python
• Ruby/Ruby on Rails
• Go
• Swift
• JavaScript
• HTML (Hypertext Markup Language)
• PHP (Hypertext Preprocessor)
• SQL (Structured Query Language)
B. Procedural programming
1. Procedural programming definition
Procedure programming is the first programming model that programmers will learn. Procedure
programming divides a program into smaller procedures, or functions, that contain the steps to be
performed. To make it more understandable, the procedural programming will write down lists of

1
instructions for the computer to do step by step what needs to be done in the most reasonable way
to complete the task. (Bhatia, 2020)

2. Key Features of Procedural Programming


❖ Predefined functions: Predefined functions are methods that have been defined or
otherwise built into the library of the program you use. (Bhatia, 2020)
❖ Local Variable: The declaration is in the main structure of the method and it is limited to
the local scope it is given. Local variables can only be used in the method defined.
❖ Global Variable: External declaration of all other functions defined in the code.
Therefore, global variables can be used in all functions, unlike a local variable.
❖ Modularity: Grouping two systems are available with two different tasks to complete a
larger task. Each system group will then complete each task until all the tasks are
completed. (Bhatia, 2020)
❖ Parameter Passing: A mechanism used to pass parameters to functions, subroutines or
procedures. (Bhatia, 2020)

3. Advantages and Disadvantages of Procedural Programming


Advantages Disadvantages
• Contains a large amount of online • When the procedure programming is
references on experimental algorithms, used, the program code will be more
making learning easier. difficult to write.
• Don’t need to copy the code because • Difficult to relate with real world
you can reuse it in different parts of the objects.
program. • The Procedural code is often not
• Easily track program flow. reusable.
• Needs only less memory. • No data security is allowed because the
• Its relative simplicity, and ease of data is exposed to the entire program.
implementation of compilers and (Bhatia, 2020)
interpreters. (Bhatia, 2020)

2
II. TASK 2
A. Identify the data types and variables required in the program
❖ Show student IDs: int IDs[30];
❖ Present student’s grades: float grades[30];
❖ Declare highest grade and lowest grade: float max, min;
❖ Show student IDs who highest grade and lowest grade: int maxID, minID;
❖ Reports option that user choose: int choice;
❖ Declare number of students: int n;
❖ Used in loop function and be numeral number in array function: int i, j;

B. Identify and describe 2 different selection structures


1. ‘if ’ statement function
It allows the program to check certain conditions and allow which source code to be executed. It
is used to let math teachers know which students have the highest grade and lowest grade.

• Example: 1, min

2, max

Note: min is lowest grade and max is the highest grade.

2. Switch case statement function


It is used in situations where the expression being evaluated results in multiple values. Math
teacher can choose different options in "Menu options" when I use it to declare different options.

• Example:

3
C. Identify and describe any iteration constructs
1. For Loop
This function helps math teachers find students’ highest grade and lowest grade. We can also
compare “min”, “max” with every element in memory.

• Example: 1, min

2, max

4
D. Split the program into functions (sub-functions) and draw a
hierarchy diagram to illustrate the structure of program

III. TASK 3
A. A use case diagram for actions required

5
B. Flowchart diagrams
1. Menu operation

6
2. Printing IDs and Grades

7
3. Finding max grade and finding min grade

8
IV. References
Anon., n.d. computerscience. [Online]
Available at: https://www.computerscience.org/resources/computer-programming-
languages/
[Accessed 4 3 2020].

Bhatia, S., 2020. hackr. [Online]


Available at: https://hackr.io/blog/procedural-programming
[Accessed 4 3 2020].

khushipuri37, n.d. geeksforgeeks. [Online]


Available at: https://www.geeksforgeeks.org/introduction-to-programming-languages/
[Accessed 4 3 2020].

You might also like