











Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!












LO1. Understand the principles of procedural programming
LO2. Be able to design procedural programming solutions
Task 2. 2.1. Identify the program units and data and file structures required to implement a given design Variable: Variable has been used to contain information to be manipulated and referenced. These variable also provide for developer a label data with a descriptive naming, so reader and us easy to understand our program. We can also know variable like containers that store information, label, data in memory and will be used throughout in program. Data type: In computer just know some types of data like numbers (1, 2, 3, 3.14), boolean values (true/false), characters (‘B’, ‘A’, ‘O’), lists of data and structures of data, etc. We create new data types by link together other data types. Some main variable I use in my program Numbe r Variable name Class Value Type Description Why 1 sID Studen t string Student id String because ID have a number and character with GTxxxxx or GCxxxxx 2 sName Studen t string Student name String because name is character 3 sDoB Studen t Date Student date of birth Date because Date of Birth is date 4 sEmail Studen t string Student email Because email have number, character and special character ([email protected]) 5 sPhone Studen t string Student Phone Because Phone start with number zero(0) and have 10- 11 number 6 sAddress Studen t string Student address Because address have number, character and special character 7 sBatch Studen t string Batch id of the student Because have number, character 8 status Studen t int Student status for delete with values: 0: deleted 1: activiting Int variable easy to know status
If-else syntax: Is the boolean_expression to check true or false Example: I use if-else to validation user input if id is null will show error and if not null will show information students Switch-case syntax: This usually with lot of case in program like menu, etc. Example:
In this case I use for loop to view all student in array While loops Syntax: This loops will repeat until condition is true Example:
In this case I use while loops to check input if user input not correct will show error and user must input again until input correct. Modules: string to input character and execute to program, ctime to get today in machine and stdafx.h is a library of visual studio 2017 to run C++ code. string in my code use to contain information variable ctime in my code use to get date(today) in computer 2.2. Design a procedural programming solution for a given problem Use case diagram
+ Update information student
+ Search student
**Input Student name to search information If False Print error message End If If True Show student information End If Return to main menu END