Unit 1: Programming Submission PDF
VerifiedAdded on 2022/01/15
|36
|7565
|62
AI Summary
Contribute Materials
Your contribution can guide someone’s learning journey. Share your
documents today.
ASSIGNMENT 1 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 1: Programming
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Student ID
Class RT7 Assessor name
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
Grading grid
P1 M1 D1
1
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 1: Programming
Submission date Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Student ID
Class RT7 Assessor name
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
Grading grid
P1 M1 D1
1
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
2
❒ Summative Feedback: ❒ Resubmission
Feedback:
Grade: Assessor Signature: Date:
Lecturer Signature:
1
Feedback:
Grade: Assessor Signature: Date:
Lecturer Signature:
1
2
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Table of Contents
I. Introduction.........................................................................................................................5
II. Algorithm.............................................................................................................................5
1. Definition of algorithm....................................................................................................6
2. The characteristics of an algorithm..................................................................................7
3. Advantages and disadvantages of algorithm....................................................................8
4. Algorithm for Simple Problem........................................................................................8
III. Business problems.........................................................................................................11
1. Definition of business problems....................................................................................11
2. Steps for problem solving..............................................................................................11
2.1 Analyzing the problem...........................................................................................12
2.2 Developing an algorithm........................................................................................12
2.3 Coding....................................................................................................................12
2.4 Testing and Debugging...........................................................................................12
3. Solve business problems by algorithms.........................................................................13
3.1 Analyze the problem...............................................................................................13
3.2 Function..................................................................................................................15
IV. Demonstrate application...................................................................................................21
1. Demonstrate and run program.......................................................................................21
2. SDLC and source code...................................................................................................29
V. Evaluation problem...........................................................................................................31
1. Test plan and test case....................................................................................................31
2. Evaluation how to solve problems from algorithms......................................................33
VI. Conclusion........................................................................................................................33
VII. References......................................................................................................................34
3
I. Introduction.........................................................................................................................5
II. Algorithm.............................................................................................................................5
1. Definition of algorithm....................................................................................................6
2. The characteristics of an algorithm..................................................................................7
3. Advantages and disadvantages of algorithm....................................................................8
4. Algorithm for Simple Problem........................................................................................8
III. Business problems.........................................................................................................11
1. Definition of business problems....................................................................................11
2. Steps for problem solving..............................................................................................11
2.1 Analyzing the problem...........................................................................................12
2.2 Developing an algorithm........................................................................................12
2.3 Coding....................................................................................................................12
2.4 Testing and Debugging...........................................................................................12
3. Solve business problems by algorithms.........................................................................13
3.1 Analyze the problem...............................................................................................13
3.2 Function..................................................................................................................15
IV. Demonstrate application...................................................................................................21
1. Demonstrate and run program.......................................................................................21
2. SDLC and source code...................................................................................................29
V. Evaluation problem...........................................................................................................31
1. Test plan and test case....................................................................................................31
2. Evaluation how to solve problems from algorithms......................................................33
VI. Conclusion........................................................................................................................33
VII. References......................................................................................................................34
3
Table of figures
Figure 1. What is algorithm?......................................................................................................6
Figure 2. Properties of algorithm................................................................................................7
Figure 3. Shapes or symbol to draw flow charts.........................................................................9
Figure 4. Flowchart to calculate square of a number................................................................10
Figure 5. Code to calculate square of a number........................................................................10
Figure 6. The result of the algorithm to find the square of a number.......................................10
Figure 7. Step for problem solving...........................................................................................12
Figure 8. Operation diagram of the program............................................................................14
Figure 9. Variables and data types............................................................................................15
Figure 10. Menu of system.......................................................................................................15
Figure 11. Flowchart Main menu..............................................................................................16
Figure 12. Flowchart Input Student..........................................................................................18
Figure 13. Flowchart Print information of student...................................................................19
Figure 14. Flowchart function Rank.........................................................................................20
Figure 15. Flowchart function Average....................................................................................21
Figure 16. Flowchart function Pass..........................................................................................21
Figure 17. Main menu...............................................................................................................22
Figure 18. Menu result..............................................................................................................23
Figure 19. Code function input.................................................................................................24
Figure 20. Code function print..................................................................................................24
Figure 21. Input data.................................................................................................................24
Figure 22. Function input..........................................................................................................25
Figure 23. Result of function print............................................................................................26
Figure 24. Code function rank..................................................................................................26
Figure 25. Result of unction rank.............................................................................................27
Figure 26. Code of function average.........................................................................................27
Figure 27. Result of function average.......................................................................................28
Figure 28. Code function pass..................................................................................................28
Figure 29. Result of function pass............................................................................................29
Figure 30. Exit program............................................................................................................29
Figure 31. C# code compilation................................................................................................30
Figure 32. Test plan..................................................................................................................31
Figure 33. Test case..................................................................................................................32
4
Figure 1. What is algorithm?......................................................................................................6
Figure 2. Properties of algorithm................................................................................................7
Figure 3. Shapes or symbol to draw flow charts.........................................................................9
Figure 4. Flowchart to calculate square of a number................................................................10
Figure 5. Code to calculate square of a number........................................................................10
Figure 6. The result of the algorithm to find the square of a number.......................................10
Figure 7. Step for problem solving...........................................................................................12
Figure 8. Operation diagram of the program............................................................................14
Figure 9. Variables and data types............................................................................................15
Figure 10. Menu of system.......................................................................................................15
Figure 11. Flowchart Main menu..............................................................................................16
Figure 12. Flowchart Input Student..........................................................................................18
Figure 13. Flowchart Print information of student...................................................................19
Figure 14. Flowchart function Rank.........................................................................................20
Figure 15. Flowchart function Average....................................................................................21
Figure 16. Flowchart function Pass..........................................................................................21
Figure 17. Main menu...............................................................................................................22
Figure 18. Menu result..............................................................................................................23
Figure 19. Code function input.................................................................................................24
Figure 20. Code function print..................................................................................................24
Figure 21. Input data.................................................................................................................24
Figure 22. Function input..........................................................................................................25
Figure 23. Result of function print............................................................................................26
Figure 24. Code function rank..................................................................................................26
Figure 25. Result of unction rank.............................................................................................27
Figure 26. Code of function average.........................................................................................27
Figure 27. Result of function average.......................................................................................28
Figure 28. Code function pass..................................................................................................28
Figure 29. Result of function pass............................................................................................29
Figure 30. Exit program............................................................................................................29
Figure 31. C# code compilation................................................................................................30
Figure 32. Test plan..................................................................................................................31
Figure 33. Test case..................................................................................................................32
4
I. Introduction
Algorithm is a concept of Mathematics and Informatics. The study of algorithms is very
important in computer science in general, or software programming in particular. My report
will provide a definition of what an algorithm is and outline the process in building an
application.
My assignment includes 4 parts:
First, I need to provide an overview about Algorithm with image illustration,
explanation and example. Next, I will represent a small and simple problem, why it is
needed to be solved and how an algorithm could help to solve it.
Secondly, I will analyze the business problem and turn it into application requirements
Thirdly, you have to demonstrate how the application is implemented by using
suitable programming language.
Finally, I will evaluate how the problem is solved from the designed algorithm to the
execution program written by a specific programming language.
II. Algorithm
Can you think of a day in your life which goes without problem solving? Of course, the
answer to this question is, No. In life, we are bound to solve problems. In our daily activities,
such as buying something from a general store and paying, depositing money in school or
withdrawing money from a bank account. All of these activities involve some kind of problem
solving. It can be said that any activity that a human or a machine performs to achieve a
particular goal is accompanied by problem solving. To make it clearer, let us look at some
other examples.
Example 1: If you are watching a news channel on your TV and you want to change it to a
sports channel, you need to do something i.e., move to that channel by pressing that channel
number on your remote. This is a kind of problem solving.
Example 2: If someone asks to you, what time is it? So, seeing the time on your watch and
telling him is also a way of solving the problem.
Now, broadly we can say that problem is a kind of barrier to achieve something and problem
solving is a process to get that barrier removed by performing some sequence of activities.
If you can solve a given problem then you can also write an algorithm for it.
In next section we will learn what is an algorithm.
5
Algorithm is a concept of Mathematics and Informatics. The study of algorithms is very
important in computer science in general, or software programming in particular. My report
will provide a definition of what an algorithm is and outline the process in building an
application.
My assignment includes 4 parts:
First, I need to provide an overview about Algorithm with image illustration,
explanation and example. Next, I will represent a small and simple problem, why it is
needed to be solved and how an algorithm could help to solve it.
Secondly, I will analyze the business problem and turn it into application requirements
Thirdly, you have to demonstrate how the application is implemented by using
suitable programming language.
Finally, I will evaluate how the problem is solved from the designed algorithm to the
execution program written by a specific programming language.
II. Algorithm
Can you think of a day in your life which goes without problem solving? Of course, the
answer to this question is, No. In life, we are bound to solve problems. In our daily activities,
such as buying something from a general store and paying, depositing money in school or
withdrawing money from a bank account. All of these activities involve some kind of problem
solving. It can be said that any activity that a human or a machine performs to achieve a
particular goal is accompanied by problem solving. To make it clearer, let us look at some
other examples.
Example 1: If you are watching a news channel on your TV and you want to change it to a
sports channel, you need to do something i.e., move to that channel by pressing that channel
number on your remote. This is a kind of problem solving.
Example 2: If someone asks to you, what time is it? So, seeing the time on your watch and
telling him is also a way of solving the problem.
Now, broadly we can say that problem is a kind of barrier to achieve something and problem
solving is a process to get that barrier removed by performing some sequence of activities.
If you can solve a given problem then you can also write an algorithm for it.
In next section we will learn what is an algorithm.
5
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
1. Definition of algorithm
Algorithm is one of the foundations of programming. There are many definitions of
algorithms, such as:
Algorithm can be defined as: “A sequence of activities to be processed for getting desired
output from a given input.”
Webopedia defines an algorithm as: “A formula or set of steps for solving a particular
problem. To be an algorithm, a set of rules must be unambiguous and have a clear stopping
point”. There can be many ways to solve a problem, so there can be more than one algorithm
for a problem.
Now, if we take definition of algorithm as: “A sequence of activities to be processed for
getting desired output from a given input.” This is why algorithm refers to a set of
rules/instructions that define step by step how to do work to achieve an expected result.
Figure 1. What is algorithm?
Thus, the entire algorithmic flowchart will have three main components:
Input: What we already know or things we have to start with.
Algorithm: A set of sequenced steps that we need to follow one by one.
Output: The expected results we need to achieve in the end.
Algorithms take in zero or more inputs and give back one or more outputs. A recipe is a good
example of an algorithm because it tells you what you need to do step by step. It takes inputs
(ingredients) and produces an output. For instance, the Coffee Maker Algorithm would run
something like
Turn on Coffee Maker
Grind Coffee Beans
Put in filter and place coffee in filter
Add Water
Start brewing process
Drink coffee.
In computer programming, algorithms are often created as functions. These functions serve as
small programs that can be referenced by a larger program. For example, an image viewing
application may include a library of functions that each use a custom algorithm to render
6
Algorithm is one of the foundations of programming. There are many definitions of
algorithms, such as:
Algorithm can be defined as: “A sequence of activities to be processed for getting desired
output from a given input.”
Webopedia defines an algorithm as: “A formula or set of steps for solving a particular
problem. To be an algorithm, a set of rules must be unambiguous and have a clear stopping
point”. There can be many ways to solve a problem, so there can be more than one algorithm
for a problem.
Now, if we take definition of algorithm as: “A sequence of activities to be processed for
getting desired output from a given input.” This is why algorithm refers to a set of
rules/instructions that define step by step how to do work to achieve an expected result.
Figure 1. What is algorithm?
Thus, the entire algorithmic flowchart will have three main components:
Input: What we already know or things we have to start with.
Algorithm: A set of sequenced steps that we need to follow one by one.
Output: The expected results we need to achieve in the end.
Algorithms take in zero or more inputs and give back one or more outputs. A recipe is a good
example of an algorithm because it tells you what you need to do step by step. It takes inputs
(ingredients) and produces an output. For instance, the Coffee Maker Algorithm would run
something like
Turn on Coffee Maker
Grind Coffee Beans
Put in filter and place coffee in filter
Add Water
Start brewing process
Drink coffee.
In computer programming, algorithms are often created as functions. These functions serve as
small programs that can be referenced by a larger program. For example, an image viewing
application may include a library of functions that each use a custom algorithm to render
6
different image file formats. An image editing program may contain algorithms designed to
process image data. Examples of image processing algorithms include cropping, resizing,
sharpening, blurring, red-eye reduction, and color enhancement.
Algorithm is developed first before writing the program. By using good algorithm, we can
improve efficiency of the program. Algorithm is not the complete program or code, it is just a
solution of a problem or the set of steps that are required to solve a problem, which can be
represented either using a Flowchart or Pseudo code.
2. The characteristics of an algorithm
Donald Ervin Knuth has given a list of five properties for a, algorithm, these properties are:
Figure 2. Properties of algorithm
1) Input: An algorithm must be provided with 0 or more number of input/data values or
in some cases no external input is provided.
2) Output: After processing the statements in algorithm step-by-step statements will
generate some result. Hence at least 1 output must be produced. This enables us to
verify the algorithm.
3) Finiteness: An algorithm must always terminate after a finite number of steps. It
means after every step one reach closer to solution of the problem and after a finite
number of steps algorithm reaches to an end point.
For example
1. Let a = 10
2. If a >10 then go to step 5
3. x = y * z
7
process image data. Examples of image processing algorithms include cropping, resizing,
sharpening, blurring, red-eye reduction, and color enhancement.
Algorithm is developed first before writing the program. By using good algorithm, we can
improve efficiency of the program. Algorithm is not the complete program or code, it is just a
solution of a problem or the set of steps that are required to solve a problem, which can be
represented either using a Flowchart or Pseudo code.
2. The characteristics of an algorithm
Donald Ervin Knuth has given a list of five properties for a, algorithm, these properties are:
Figure 2. Properties of algorithm
1) Input: An algorithm must be provided with 0 or more number of input/data values or
in some cases no external input is provided.
2) Output: After processing the statements in algorithm step-by-step statements will
generate some result. Hence at least 1 output must be produced. This enables us to
verify the algorithm.
3) Finiteness: An algorithm must always terminate after a finite number of steps. It
means after every step one reach closer to solution of the problem and after a finite
number of steps algorithm reaches to an end point.
For example
1. Let a = 10
2. If a >10 then go to step 5
3. x = y * z
7
4. Print x and go to step 2
5. Stop.
Here we notice that in algorithm the value of a is not changed, which happens to be
controlling the flow and hence never terminates. Such statement must be avoided. The
finiteness property ensures that the unambiguity in the flow.
4) Definiteness: Each step of an algorithm must be precisely defined. An algorithm must
be unambiguous and clear. Each step of algorithm and input/outputs must be clear.
There is only one meaning of each step of algorithm.
5) Effectiveness: Algorithms to be developed/written using basic operations. It must be
possible that every step of the algorithm to be carried out by a person manually using
only pencil and paper. The statements of algorithm must be feasible to convert in
computer program.
3. Advantages and disadvantages of algorithm
Advantages of algorithm:
Algorithms are easy to understand.
It is very helpful for a programmer to write a code by understanding the algorithm.
It breaks down the logic or problem inti simple steps or a set instruction.
Every step in an algorithm has its own logical sequence so it is easy to debug.
Disadvantages of algorithm:
Algorithms take more time to apply on.
An algorithm is not a computer program; rather, it is a concept that describes how a
program should be written.
Big programs are difficult to add in an Algorithmic way.
Complex logic can be quite confusing when using algorithms.
In algorithms, it is difficult to show branching and looping statements.
4. Algorithm for Simple Problem
From the example of how-to-make-tea which I have already mentioned earlier. I want to give
out more examples and to show that algorithms also take part in procedural programming.
Here, I will use Flowchart to illustrate the algorithm. So, what is Flowchart?
A flowchart is a visual representation of an algorithm.
A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows.
Each shape represents a step of the solution process and the arrow represents the order or link
among the steps.
There are standardized symbols to draw flowcharts. Some are given in Table below.
8
5. Stop.
Here we notice that in algorithm the value of a is not changed, which happens to be
controlling the flow and hence never terminates. Such statement must be avoided. The
finiteness property ensures that the unambiguity in the flow.
4) Definiteness: Each step of an algorithm must be precisely defined. An algorithm must
be unambiguous and clear. Each step of algorithm and input/outputs must be clear.
There is only one meaning of each step of algorithm.
5) Effectiveness: Algorithms to be developed/written using basic operations. It must be
possible that every step of the algorithm to be carried out by a person manually using
only pencil and paper. The statements of algorithm must be feasible to convert in
computer program.
3. Advantages and disadvantages of algorithm
Advantages of algorithm:
Algorithms are easy to understand.
It is very helpful for a programmer to write a code by understanding the algorithm.
It breaks down the logic or problem inti simple steps or a set instruction.
Every step in an algorithm has its own logical sequence so it is easy to debug.
Disadvantages of algorithm:
Algorithms take more time to apply on.
An algorithm is not a computer program; rather, it is a concept that describes how a
program should be written.
Big programs are difficult to add in an Algorithmic way.
Complex logic can be quite confusing when using algorithms.
In algorithms, it is difficult to show branching and looping statements.
4. Algorithm for Simple Problem
From the example of how-to-make-tea which I have already mentioned earlier. I want to give
out more examples and to show that algorithms also take part in procedural programming.
Here, I will use Flowchart to illustrate the algorithm. So, what is Flowchart?
A flowchart is a visual representation of an algorithm.
A flowchart is a diagram made up of boxes, diamonds and other shapes, connected by arrows.
Each shape represents a step of the solution process and the arrow represents the order or link
among the steps.
There are standardized symbols to draw flowcharts. Some are given in Table below.
8
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Flowchart
symbol
Function Description
Start/End Also called “Terminator” symbol. It indicates
where the flow starts and ends.
Process Also called “Action Symbol”, it represents a
process, action, or a single step.
Decision A decision or branching point, usually a yes/no
or true/false question is asked, and based on the
answer, a path gets split into two branches.
Input/Output Also called data symbol, this parallelogram
shape is used to input or output data.
Arrow Connector to show order of flow between
shapes.
Figure 3. Shapes or symbol to draw flow charts
Some examples of algorithms.
Example 1: Write an algorithm to find the square of a number.
Before developing the algorithm, let us first identify the input, process and output:
Input: Number whose square is required
Process: Multiply the number by itself to get its square.
Output: Square of the number.
Algorithm to find square of a number.
Step 1: Input a number and store it to num
Step 2: Compute num * num and store it in square
Step 3: Print square
There can be represented pictorially using flowchart as show in Figure below.
9
symbol
Function Description
Start/End Also called “Terminator” symbol. It indicates
where the flow starts and ends.
Process Also called “Action Symbol”, it represents a
process, action, or a single step.
Decision A decision or branching point, usually a yes/no
or true/false question is asked, and based on the
answer, a path gets split into two branches.
Input/Output Also called data symbol, this parallelogram
shape is used to input or output data.
Arrow Connector to show order of flow between
shapes.
Figure 3. Shapes or symbol to draw flow charts
Some examples of algorithms.
Example 1: Write an algorithm to find the square of a number.
Before developing the algorithm, let us first identify the input, process and output:
Input: Number whose square is required
Process: Multiply the number by itself to get its square.
Output: Square of the number.
Algorithm to find square of a number.
Step 1: Input a number and store it to num
Step 2: Compute num * num and store it in square
Step 3: Print square
There can be represented pictorially using flowchart as show in Figure below.
9
Figure 4. Flowchart to calculate square of a number
The below program asks the user to enter the value. After getting the value from the user it
will calculate the square of entered number by using arithmetic multiplication operator.
Figure 5. Code to calculate square of a number
And the result:
Figure 6. The result of the algorithm to find the square of a number
10
The below program asks the user to enter the value. After getting the value from the user it
will calculate the square of entered number by using arithmetic multiplication operator.
Figure 5. Code to calculate square of a number
And the result:
Figure 6. The result of the algorithm to find the square of a number
10
III. Business problems
1. Definition of business problems
Business problems are simply comprehended as realistic problems from daily life which need
implementing in a product. Business problems are current or long-term challenges and issues
faced by a business. These may prevent a business from executing strategy and achieving
goals. In some cases, business problems also threaten the long-term survival of a firm.
Besides, business problems are hugely mistaken with logical coding, which is completely
wrong and should be appeared in holistic view.
On the other hand, with the help of algorithms, business problems are implemented in a
software product which is highly difficult in logic.
For instance, a large number of tech businesses face the issue of trial users falling meaning the
users take trials but do not come back to become paying users. This is a business problem. As
well as, the problem of taking thousands and millions of orders on mobile shipping app per
day is also the one that companies fear to face if they wanted to create their own application.
Why we need to go for algorithm to solve business problem?
A computer is a tool that can be used to implement a plan for solving a problem.
A computer program is a set of instructions for a computer. These instructions
describe the steps that the computer must follow to implement a plan.
An algorithm is a plan for solving a problem.
A person must design an algorithm.
A person must translate an algorithm into a computer program.
2. Steps for problem solving
Suppose while driving, a car starts making strange noises. We may not know how to solve the
problem right away. First, we need to determine where the noise is coming from? In case the
problem cannot be solved by us, then we need to take the car to a mechanic. The mechanic
will analyze the problem to determine the source of the noise, plan the work to be done and
finally repair the car to remove the noise. From the above example, it is explicit that, finding a
solution to a problem might consist of multiple steps.
When problems are straightforward and easy, we can easily find the solution. But a complex
problem requires a methodical approach to find the right solution. In other words, we have to
apply problem solving techniques. Problem solving begins with the precise identification of
the problem and ends with a complete working solution in terms of a program or software.
Key steps required for solving a problem using a computer are shown in Figure below and are
discussed in following subsections.
11
1. Definition of business problems
Business problems are simply comprehended as realistic problems from daily life which need
implementing in a product. Business problems are current or long-term challenges and issues
faced by a business. These may prevent a business from executing strategy and achieving
goals. In some cases, business problems also threaten the long-term survival of a firm.
Besides, business problems are hugely mistaken with logical coding, which is completely
wrong and should be appeared in holistic view.
On the other hand, with the help of algorithms, business problems are implemented in a
software product which is highly difficult in logic.
For instance, a large number of tech businesses face the issue of trial users falling meaning the
users take trials but do not come back to become paying users. This is a business problem. As
well as, the problem of taking thousands and millions of orders on mobile shipping app per
day is also the one that companies fear to face if they wanted to create their own application.
Why we need to go for algorithm to solve business problem?
A computer is a tool that can be used to implement a plan for solving a problem.
A computer program is a set of instructions for a computer. These instructions
describe the steps that the computer must follow to implement a plan.
An algorithm is a plan for solving a problem.
A person must design an algorithm.
A person must translate an algorithm into a computer program.
2. Steps for problem solving
Suppose while driving, a car starts making strange noises. We may not know how to solve the
problem right away. First, we need to determine where the noise is coming from? In case the
problem cannot be solved by us, then we need to take the car to a mechanic. The mechanic
will analyze the problem to determine the source of the noise, plan the work to be done and
finally repair the car to remove the noise. From the above example, it is explicit that, finding a
solution to a problem might consist of multiple steps.
When problems are straightforward and easy, we can easily find the solution. But a complex
problem requires a methodical approach to find the right solution. In other words, we have to
apply problem solving techniques. Problem solving begins with the precise identification of
the problem and ends with a complete working solution in terms of a program or software.
Key steps required for solving a problem using a computer are shown in Figure below and are
discussed in following subsections.
11
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Figure 7. Step for problem solving
2.1 Analyzing the problem
It is important to clearly understand a problem before we begin to find a solution to it. If it is
not clear to us what will be resolved, we may end up developing a program that may not solve
our purpose. Therefore, we need to read and analyze the statement carefully to list the main
components of the problem and decide what core functions our solution should have. By
analyzing a problem, we will be able to figure out what input our program should accept and
what output the program should produce.
2.2 Developing an algorithm
It is essential to device a solution before writing a program code for a given problem. The
solution is represented in natural language and is called an algorithm. We can imagine an
algorithm like a very well-written recipe for a dish, with clearly defined steps that, if
followed, one will end up preparing the dish.
We start with a tentative solution plan and keep on refining the algorithm until the algorithm
is able to capture all the aspects of the desired solution. For a given problem, more than one
algorithm is possible and we have to select the most suitable solution.
2.3 Coding
After finalizing the algorithm, we need to convert the algorithm into the format which can be
understood by the computer to generate the desired solution. Different high level
programming languages can be used for writing a program.
2.4 Testing and Debugging
The program created should be tested on various parameters. The program should meet the
requirements of the user. It must respond within the expected time. It should generate correct
12
2.1 Analyzing the problem
It is important to clearly understand a problem before we begin to find a solution to it. If it is
not clear to us what will be resolved, we may end up developing a program that may not solve
our purpose. Therefore, we need to read and analyze the statement carefully to list the main
components of the problem and decide what core functions our solution should have. By
analyzing a problem, we will be able to figure out what input our program should accept and
what output the program should produce.
2.2 Developing an algorithm
It is essential to device a solution before writing a program code for a given problem. The
solution is represented in natural language and is called an algorithm. We can imagine an
algorithm like a very well-written recipe for a dish, with clearly defined steps that, if
followed, one will end up preparing the dish.
We start with a tentative solution plan and keep on refining the algorithm until the algorithm
is able to capture all the aspects of the desired solution. For a given problem, more than one
algorithm is possible and we have to select the most suitable solution.
2.3 Coding
After finalizing the algorithm, we need to convert the algorithm into the format which can be
understood by the computer to generate the desired solution. Different high level
programming languages can be used for writing a program.
2.4 Testing and Debugging
The program created should be tested on various parameters. The program should meet the
requirements of the user. It must respond within the expected time. It should generate correct
12
output for all possible inputs. In the presence of syntactical errors, no output will be obtained.
In case the output generated is incorrect, then the program should be checked for logical
errors, if any.
Software industry follows standardized testing methods like unit or component testing,
integration testing, system testing, and acceptance testing while developing complex
applications. This is to ensure that the software meets all the business and technical
requirements and works as expected. The errors or defects found in the testing phases are
debugged or rectified and the program is again tested. This continues till all the errors are
removed from the program.
Once the software application has been developed, tested and delivered to the user, still
problems in terms of functioning can come up and need to be resolved from time to time. The
maintenance of the solution, thus, involves fixing the problems faced by the user, answering
the queries of the user and even serving the request for addition or modification of features.
3. Solve business problems by algorithms
To be able to understand more about the algorithm and its details. I will apply an algorithm to
solve a problem like this: A teacher wants to manage the final grades of students in the class.
He needs to print out the ranking of the students, calculate the average score of the students
and calculate the pass rate of the students. The program needs to enter student information,
student IDs and grades.
After entering the information, the program needs a Menu so that he can use the functions as a
After read clearly the scenario, I solved it by using an algorithm based on C# language to
create a program must have full option that satisfy the requirement of teacher. C# is a general
object-oriented programming (OOP) language for networking and Web development. C# is
specified as a common language infrastructure (CLI) language. In January 1999, Dutch
software engineer Anders Hejlsberg formed a team to develop C# as a complement to
Microsoft’s NET framework. Initially, C# was developed as C-Like Object Oriented
Language (Cool). The actual name was changed to avert potential trademark issues. In
January 2000, NET was released as C#. Its NET framework promotes multiple Web
technologies.
Here, we need to create an application to enter name, score, ID above.
3.1 Analyze the problem
To solve the above problem, we need the Input and Output integration of the problem. Here,
the teacher will enter the student's information and ask the program to print out the student
rankings, the grade point average of the class and the passing rate of the students. So, we can
summarize the input and output as follows:
Input: Student's information including ID, name and grade.
Output: Ranking, GPA and pass rate of students in the class.
13
In case the output generated is incorrect, then the program should be checked for logical
errors, if any.
Software industry follows standardized testing methods like unit or component testing,
integration testing, system testing, and acceptance testing while developing complex
applications. This is to ensure that the software meets all the business and technical
requirements and works as expected. The errors or defects found in the testing phases are
debugged or rectified and the program is again tested. This continues till all the errors are
removed from the program.
Once the software application has been developed, tested and delivered to the user, still
problems in terms of functioning can come up and need to be resolved from time to time. The
maintenance of the solution, thus, involves fixing the problems faced by the user, answering
the queries of the user and even serving the request for addition or modification of features.
3. Solve business problems by algorithms
To be able to understand more about the algorithm and its details. I will apply an algorithm to
solve a problem like this: A teacher wants to manage the final grades of students in the class.
He needs to print out the ranking of the students, calculate the average score of the students
and calculate the pass rate of the students. The program needs to enter student information,
student IDs and grades.
After entering the information, the program needs a Menu so that he can use the functions as a
After read clearly the scenario, I solved it by using an algorithm based on C# language to
create a program must have full option that satisfy the requirement of teacher. C# is a general
object-oriented programming (OOP) language for networking and Web development. C# is
specified as a common language infrastructure (CLI) language. In January 1999, Dutch
software engineer Anders Hejlsberg formed a team to develop C# as a complement to
Microsoft’s NET framework. Initially, C# was developed as C-Like Object Oriented
Language (Cool). The actual name was changed to avert potential trademark issues. In
January 2000, NET was released as C#. Its NET framework promotes multiple Web
technologies.
Here, we need to create an application to enter name, score, ID above.
3.1 Analyze the problem
To solve the above problem, we need the Input and Output integration of the problem. Here,
the teacher will enter the student's information and ask the program to print out the student
rankings, the grade point average of the class and the passing rate of the students. So, we can
summarize the input and output as follows:
Input: Student's information including ID, name and grade.
Output: Ranking, GPA and pass rate of students in the class.
13
The following diagram will help us understand more about the requirements of the problem:
Figure 8. Operation diagram of the program
As mentioned above, I will use C# language in this program. In addition, I will apply the
experience gained from Procedural Programming to write programs that are easiest to
understand. I will demonstrate how I include the libraries, variables, conditional expressions,
and loops that I use to write the program.
3.1.1 Library
In this program I plan to use 2 libraries to meet the needs of the problem. That is:
Basic library of a Console Application, using commands like Console.Writeline (),
Console.Readline(), conditional structure, etc.
3.1.2 Variables and data types
To solve this problem, I plan to use 3 main data types string, integer and double. Where
variables using integer data type will be used for user selection in menu (choice), double data
type will be used for number of students (number), total student score (sum), total number of
students passed (count), intermediate variable to sort student score (compare) and student
score (grade). And finally, the variables that will use the string data type are: the student’s
14
Figure 8. Operation diagram of the program
As mentioned above, I will use C# language in this program. In addition, I will apply the
experience gained from Procedural Programming to write programs that are easiest to
understand. I will demonstrate how I include the libraries, variables, conditional expressions,
and loops that I use to write the program.
3.1.1 Library
In this program I plan to use 2 libraries to meet the needs of the problem. That is:
Basic library of a Console Application, using commands like Console.Writeline (),
Console.Readline(), conditional structure, etc.
3.1.2 Variables and data types
To solve this problem, I plan to use 3 main data types string, integer and double. Where
variables using integer data type will be used for user selection in menu (choice), double data
type will be used for number of students (number), total student score (sum), total number of
students passed (count), intermediate variable to sort student score (compare) and student
score (grade). And finally, the variables that will use the string data type are: the student’s
14
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
name (name), student’s ID (ID), intermediate variable to change student code according to
grade arrangement (id). To be clearer, I will create a table of the variables that I use in this
program.
Data type Variable Function
Integer choice Get user selected silk
Double number Declare the number of students
sum Calculate the total score of the student
count Calculate the number of students who pass the course
compare The intermediate variable to sort the student’s score
grade Declare student’s grade
String ID Declare the ID of the student
name Declare the name of the student
id The intermediate variable to change the student’s ID
according to the score arrangement.
Figure 9. Variables and data types
3.2 Function
Here, I will use flowchart to show the algorithms that I will use in the system.
1) Menu
The system includes the following features:
Figure 10. Menu of system
15
grade arrangement (id). To be clearer, I will create a table of the variables that I use in this
program.
Data type Variable Function
Integer choice Get user selected silk
Double number Declare the number of students
sum Calculate the total score of the student
count Calculate the number of students who pass the course
compare The intermediate variable to sort the student’s score
grade Declare student’s grade
String ID Declare the ID of the student
name Declare the name of the student
id The intermediate variable to change the student’s ID
according to the score arrangement.
Figure 9. Variables and data types
3.2 Function
Here, I will use flowchart to show the algorithms that I will use in the system.
1) Menu
The system includes the following features:
Figure 10. Menu of system
15
Figure 11. Flowchart Main menu
Algorithm (Pseudo code):
16
Algorithm (Pseudo code):
16
1.START
2. DECLARE variable choice
3. REPEAT
4. PRINT Menu
5. IF choice = 1 is true then
5.1 Program case 1
6. IF choice = 2 is true then
6.1 Program case 2
7. IF choice = 3 is true then
7.1 Program case 3
8. IF choice = 4 is true then
8.1 Program case 4
9. IF choice! = 1; 2; 3; 4 is true then
9.1 PRINT Invalid choice
10. UNTIL choice = 5
11. STOP.
2) Input information of student
17
2. DECLARE variable choice
3. REPEAT
4. PRINT Menu
5. IF choice = 1 is true then
5.1 Program case 1
6. IF choice = 2 is true then
6.1 Program case 2
7. IF choice = 3 is true then
7.1 Program case 3
8. IF choice = 4 is true then
8.1 Program case 4
9. IF choice! = 1; 2; 3; 4 is true then
9.1 PRINT Invalid choice
10. UNTIL choice = 5
11. STOP.
2) Input information of student
17
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Figure 12. Flowchart Input Student
3) Print information of student
18
3) Print information of student
18
Figure 13. Flowchart Print information of student
4) Function Rank
19
4) Function Rank
19
Figure 14. Flowchart function Rank
5) Function Average
20
5) Function Average
20
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
Figure 15. Flowchart function Average
6) Function Pass
Figure 16. Flowchart function Pass
IV. Demonstrate application
1. Demonstrate and run program
To be able to use the features without having to re-enter the data, I will put the features in the
“Switch - Case” statement into a “do – while” loop for a repeatable Menu control. program
functions for the user to choose from. In addition, I also designed an option to help the user
exit the program. If the user enters incorrectly, the program will print the message: “Wrong
choice”.
1) Main menu
21
6) Function Pass
Figure 16. Flowchart function Pass
IV. Demonstrate application
1. Demonstrate and run program
To be able to use the features without having to re-enter the data, I will put the features in the
“Switch - Case” statement into a “do – while” loop for a repeatable Menu control. program
functions for the user to choose from. In addition, I also designed an option to help the user
exit the program. If the user enters incorrectly, the program will print the message: “Wrong
choice”.
1) Main menu
21
Figure 17. Main menu
First, the program will print a message: "Input the number of students" to ask the user to enter
the number of students. If the user enters a number less than or equal to 0, the program will
print the message: “Invalid number”. Then the program will check the condition of the
"while" function. Because the condition of the while function is true, the program will
continue to execute the block in "do". When the condition of the while function is false, the
loop is stopped.
After that I print the menu list has all of things that user needs. The program will let the user
enter a value into the variable "choice". If the value matches up to [1:5], the program will
execute. If the user enters incorrectly, the program will run the default case and print the
message "Wrong choice" on the screen. The loop will be reused when the user enters the
value of choice variable as 5.
22
First, the program will print a message: "Input the number of students" to ask the user to enter
the number of students. If the user enters a number less than or equal to 0, the program will
print the message: “Invalid number”. Then the program will check the condition of the
"while" function. Because the condition of the while function is true, the program will
continue to execute the block in "do". When the condition of the while function is false, the
loop is stopped.
After that I print the menu list has all of things that user needs. The program will let the user
enter a value into the variable "choice". If the value matches up to [1:5], the program will
execute. If the user enters incorrectly, the program will run the default case and print the
message "Wrong choice" on the screen. The loop will be reused when the user enters the
value of choice variable as 5.
22
Figure 18. Menu result
This is an extremely important part of Procedural Programming. Where I created 4 more
subroutines to make it easier to manage my code.
2) Input student’s information and Print list student
23
This is an extremely important part of Procedural Programming. Where I created 4 more
subroutines to make it easier to manage my code.
2) Input student’s information and Print list student
23
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Figure 19. Code function input
When starting to run, the program declares the variable 'i' with integer data type to start
running the for loop. The program first checks the condition of the variable 'i'. If the variable
'i' is less than the variable 'number', the program will enter a do=while loop to let the user
enter information. Here, the user needs to enter 3 types of information that are the name, ID,
grade of each student and the variables respectively: "name", "ID" and "grade". After the
import is complete, those variables will be assigned to the respective libraries in turn. After
entering the information, the program will check the score that the user has just entered. Here,
using a 10-point scale, the range of grade will be [0,10]. Therefore, when the user enters a
score outside this range, the program will report an error and ask the user to re-enter it. Here,
due to using "list" to store, when the user enters it wrong, the program will delete the data that
the user has just entered in it. Since the condition in while (0 > grade || grade > 10) is true, the
program will re-execute the do block until the while condition is false. Then the value of the
variable 'i' will increase by 1 unit and the program will continue to execute the block in the do
function. When I > number, the for loop will be reused.
After I have written a function to input student information, I will use the print function to
print out student information.
Figure 20. Code function print
In the "Print" function I will use a for loop with the value that I run from 0 to the number.
With each loop run, the program will print out the name, ID and score of the corresponding
student in the list. After printing is done, variable i will increase by 1 unit and keep working
in for loop until variable i > number then "Print" function will stop.
Here I will proceed to run the program for this function. Suppose I want to input 4 students
with the following data
ID Name Grade
BHAF001 Ken 4
BHAF002 Lin 8
BHAF003 Linda 10
BHAF004 David 7.5
Figure 21. Input data
And here is the result of running the program. First, we will enter student information
including ID, name and grade.
24
When starting to run, the program declares the variable 'i' with integer data type to start
running the for loop. The program first checks the condition of the variable 'i'. If the variable
'i' is less than the variable 'number', the program will enter a do=while loop to let the user
enter information. Here, the user needs to enter 3 types of information that are the name, ID,
grade of each student and the variables respectively: "name", "ID" and "grade". After the
import is complete, those variables will be assigned to the respective libraries in turn. After
entering the information, the program will check the score that the user has just entered. Here,
using a 10-point scale, the range of grade will be [0,10]. Therefore, when the user enters a
score outside this range, the program will report an error and ask the user to re-enter it. Here,
due to using "list" to store, when the user enters it wrong, the program will delete the data that
the user has just entered in it. Since the condition in while (0 > grade || grade > 10) is true, the
program will re-execute the do block until the while condition is false. Then the value of the
variable 'i' will increase by 1 unit and the program will continue to execute the block in the do
function. When I > number, the for loop will be reused.
After I have written a function to input student information, I will use the print function to
print out student information.
Figure 20. Code function print
In the "Print" function I will use a for loop with the value that I run from 0 to the number.
With each loop run, the program will print out the name, ID and score of the corresponding
student in the list. After printing is done, variable i will increase by 1 unit and keep working
in for loop until variable i > number then "Print" function will stop.
Here I will proceed to run the program for this function. Suppose I want to input 4 students
with the following data
ID Name Grade
BHAF001 Ken 4
BHAF002 Lin 8
BHAF003 Linda 10
BHAF004 David 7.5
Figure 21. Input data
And here is the result of running the program. First, we will enter student information
including ID, name and grade.
24
Figure 22. Function input
After entering student information, the program will print a list of student information.
25
After entering student information, the program will print a list of student information.
25
Figure 23. Result of function print
3) Rank
I will use the rank () function to rank students based on their scores.
Figure 24. Code function rank
To be able to compare scores between students, I used the "Rank" function. First, I will
declare 2 variables like “compare=0 and id=" ". The two variables "compare" and "id", I will
use to swap the student's score and ID in case the second person's score is greater than the first
person's score. And to compare 2 values in a list, I will use 2 nested for loops with “int i = 0; i
< number " and " int j = i + 1; j < number ".
When the “rank” function starts running, the program will run a for loop with the variable “i”,
then continue to run the for loop with the variable “j.” If “grades [i] < grades [j]” then the
program will swap between grades and IDs of two students through two intermediate
variables "compare" and "id".
26
3) Rank
I will use the rank () function to rank students based on their scores.
Figure 24. Code function rank
To be able to compare scores between students, I used the "Rank" function. First, I will
declare 2 variables like “compare=0 and id=" ". The two variables "compare" and "id", I will
use to swap the student's score and ID in case the second person's score is greater than the first
person's score. And to compare 2 values in a list, I will use 2 nested for loops with “int i = 0; i
< number " and " int j = i + 1; j < number ".
When the “rank” function starts running, the program will run a for loop with the variable “i”,
then continue to run the for loop with the variable “j.” If “grades [i] < grades [j]” then the
program will swap between grades and IDs of two students through two intermediate
variables "compare" and "id".
26
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
After the swap is complete, the for loop with variable “j” will increment by one and keep
comparing grades[i] with grades[j] until the for loop with variable “j” is smaller than the
variable “j” "number" then the program will push the value of variable 'i' one unit and then
keep repeating the for loop with variable 'j' and compare the scores. When the value of
variable "i" is less than "number". In total, the program will print out the students' rankings on
the screen. In order to be able to print this ranking, I used the command “Console.Writeline”
to be able to print it.
Now, let us see the results of the program.
Figure 25. Result of unction rank
4) Average
In order to be able to print out the student's GPA, I will use the “Average” function.
Figure 26. Code of function average
First, I will create a variable “sum” to calculate the total score of the student. To be able to
calculate this total score, I will use a for loop with the variables “i” and “i” starting from 0 to
the number. Each time the loop is run, the sum variable is added to the student's score
(grades[i]). When the value of "i" is greater than the number, the for loop will stop. Next, I
will use the "Console.Writeline" statement to print the student's average score to the screen
according to the formula: average = total / number.
27
comparing grades[i] with grades[j] until the for loop with variable “j” is smaller than the
variable “j” "number" then the program will push the value of variable 'i' one unit and then
keep repeating the for loop with variable 'j' and compare the scores. When the value of
variable "i" is less than "number". In total, the program will print out the students' rankings on
the screen. In order to be able to print this ranking, I used the command “Console.Writeline”
to be able to print it.
Now, let us see the results of the program.
Figure 25. Result of unction rank
4) Average
In order to be able to print out the student's GPA, I will use the “Average” function.
Figure 26. Code of function average
First, I will create a variable “sum” to calculate the total score of the student. To be able to
calculate this total score, I will use a for loop with the variables “i” and “i” starting from 0 to
the number. Each time the loop is run, the sum variable is added to the student's score
(grades[i]). When the value of "i" is greater than the number, the for loop will stop. Next, I
will use the "Console.Writeline" statement to print the student's average score to the screen
according to the formula: average = total / number.
27
And this is the result after I run the program.
Figure 27. Result of function average
5) Pass
To know how many students passed the course and how many did not pass the course, I
would use the “Pass” function.
Figure 28. Code function pass
First, I declared the variable “count” to count the number of students who passed the course.
When using the “Pass” function, the program will run a for loop with the variables “i” and “i”
starting from 0 to the sum. If the student's score is greater than or equal to 5 (grades [i] > = 5),
the variable “count” will be added by 1. Until the value of “i” is greater than “total”, the for
loop will stop. again. Next, I will use “Control Panel. WriteLine” statement to be able to print
out the number of students who passed the course by printing the variable “count”. The
number of remaining students will correspond to the number of students who did not pass the
course (total - count).
And result:
28
Figure 27. Result of function average
5) Pass
To know how many students passed the course and how many did not pass the course, I
would use the “Pass” function.
Figure 28. Code function pass
First, I declared the variable “count” to count the number of students who passed the course.
When using the “Pass” function, the program will run a for loop with the variables “i” and “i”
starting from 0 to the sum. If the student's score is greater than or equal to 5 (grades [i] > = 5),
the variable “count” will be added by 1. Until the value of “i” is greater than “total”, the for
loop will stop. again. Next, I will use “Control Panel. WriteLine” statement to be able to print
out the number of students who passed the course by printing the variable “count”. The
number of remaining students will correspond to the number of students who did not pass the
course (total - count).
And result:
28
Figure 29. Result of function pass
Finally, when we want to end the program, we can choose the "Exit" function.
Figure 30. Exit program
2. SDLC and source code
1) What is SDLC?
SDLC is the acronym of Software Development Life Cycle. It is also called as Software
Development Process.
Software Development Life Cycle (SDLC) is a process used by the software industry to
design, develop and test high quality software’s. It consists of a detailed plan describing how
to develop, maintain, replace and alter or enhance specific software. The life cycle defines a
methodology for improving the quality of software and the overall development process. Any
software development process is divided in several logical stages that allow a software
company to organize its work efficiently in order to build a software product of the required
functionality within a specific time frame and budget.
2) How source code is compiled and run.
Source code is the basic component of a computer program created by a programmer. It can
be read and easily understood by a human. For example, when a programmer enters a
sequence of C# programming language statements into Windows Notepad and saves the
string as a text file, the text file is said to contain the source code.
Computers do not understand human languages. Therefore, programming languages were
invented to make it easier for humans to write computer programs. The program (source code)
29
Finally, when we want to end the program, we can choose the "Exit" function.
Figure 30. Exit program
2. SDLC and source code
1) What is SDLC?
SDLC is the acronym of Software Development Life Cycle. It is also called as Software
Development Process.
Software Development Life Cycle (SDLC) is a process used by the software industry to
design, develop and test high quality software’s. It consists of a detailed plan describing how
to develop, maintain, replace and alter or enhance specific software. The life cycle defines a
methodology for improving the quality of software and the overall development process. Any
software development process is divided in several logical stages that allow a software
company to organize its work efficiently in order to build a software product of the required
functionality within a specific time frame and budget.
2) How source code is compiled and run.
Source code is the basic component of a computer program created by a programmer. It can
be read and easily understood by a human. For example, when a programmer enters a
sequence of C# programming language statements into Windows Notepad and saves the
string as a text file, the text file is said to contain the source code.
Computers do not understand human languages. Therefore, programming languages were
invented to make it easier for humans to write computer programs. The program (source code)
29
Paraphrase This Document
Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
must be translated into machine language so that the computer can execute the program (as
the computer only understands machine language); that is the job of a special interpreter
program called a compiler. A compiler is a program that transforms source code written in
one programming language into another programming language.
Here, I will learn how C# code is compiled and executed.
Figure 31. C# code compilation
Step 1: Write C# code.
Step 2: Compile the code using a C# compiler.
Step 3: Now the compiler checks if the code has errors or not. If no errors are found, the
compiler moves on to the next step. Or if the compiler finds errors, it will immediately notify
the developer that errors are found in the given line, so that the developer can fix them.
Step 4: For C#, the source code is converted into intermediate code called Common
Intermediate Language (CIL) or Intermediate Language Code (ILC or IL code). This CIL or
IL code can run on any operating system because C# is a Platform Independent Language.
Step 5: After converting the C# source code to Common Intermediate Language (CIL) or
Intermediate Language Code (ILC or IL code, the intermediate code needs to be converted to
machine understandable code. C# uses the .NET Framework and as part of this .NET
Framework, the Virtual Machine component manages the execution of programs written in
any language that uses the .NET Framework. This virtual machine component is called
Common. Language Runtime (CLR) helps to translate CIL or IL code into native code or
machine-understandable code or machine instructions. This process is called Just-In-Time
(JIT) Compilation or Dynamic Compilation. code only during the execution of a program at
run time.
Step 6: Step 6: After the C# programs are compiled, they are physically packaged into
Assemblies. An assembly is a file that contains one or more namespaces and classes. As the
number of classes and namespaces in the program increases, it is physically separated by the
related namespaces into distinct assemblies. Assemblies usually have the file extension .exe
or .dll, depending on whether they implement the respective applications or libraries, where
EXE stands for Executable and DLL stands for Dynamic Link Library. An EXE (Executable)
30
the computer only understands machine language); that is the job of a special interpreter
program called a compiler. A compiler is a program that transforms source code written in
one programming language into another programming language.
Here, I will learn how C# code is compiled and executed.
Figure 31. C# code compilation
Step 1: Write C# code.
Step 2: Compile the code using a C# compiler.
Step 3: Now the compiler checks if the code has errors or not. If no errors are found, the
compiler moves on to the next step. Or if the compiler finds errors, it will immediately notify
the developer that errors are found in the given line, so that the developer can fix them.
Step 4: For C#, the source code is converted into intermediate code called Common
Intermediate Language (CIL) or Intermediate Language Code (ILC or IL code). This CIL or
IL code can run on any operating system because C# is a Platform Independent Language.
Step 5: After converting the C# source code to Common Intermediate Language (CIL) or
Intermediate Language Code (ILC or IL code, the intermediate code needs to be converted to
machine understandable code. C# uses the .NET Framework and as part of this .NET
Framework, the Virtual Machine component manages the execution of programs written in
any language that uses the .NET Framework. This virtual machine component is called
Common. Language Runtime (CLR) helps to translate CIL or IL code into native code or
machine-understandable code or machine instructions. This process is called Just-In-Time
(JIT) Compilation or Dynamic Compilation. code only during the execution of a program at
run time.
Step 6: Step 6: After the C# programs are compiled, they are physically packaged into
Assemblies. An assembly is a file that contains one or more namespaces and classes. As the
number of classes and namespaces in the program increases, it is physically separated by the
related namespaces into distinct assemblies. Assemblies usually have the file extension .exe
or .dll, depending on whether they implement the respective applications or libraries, where
EXE stands for Executable and DLL stands for Dynamic Link Library. An EXE (Executable)
30
file represents a program that can be executed, and a DLL (Dynamic Link Library) file
includes code (Example: Library) that can be reused on other programs together.
Step 7: Now the C# compiler returns the output of the given C# code.
V. Evaluation problem
1. Test plan and test case
I produce a test plan for this system to check if the system satisfies the scenario requirements.
The test case is presented as below:
Module test Student Management
Test requirement Test the data validation and feature operation.
Tester Do Thi Dieu Linh
Create date 10/10/2021
Time to test 1 hour
Test environment MS-DOS Figure 32. Test plan
Test
case
ID
Test
case title
How Data Expected
result
Actual
result
Evaluate
1 User
input
choice
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
2 User
input
number
students
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
Decimal data Invalid Invalid False
31
includes code (Example: Library) that can be reused on other programs together.
Step 7: Now the C# compiler returns the output of the given C# code.
V. Evaluation problem
1. Test plan and test case
I produce a test plan for this system to check if the system satisfies the scenario requirements.
The test case is presented as below:
Module test Student Management
Test requirement Test the data validation and feature operation.
Tester Do Thi Dieu Linh
Create date 10/10/2021
Time to test 1 hour
Test environment MS-DOS Figure 32. Test plan
Test
case
ID
Test
case title
How Data Expected
result
Actual
result
Evaluate
1 User
input
choice
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
2 User
input
number
students
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
Decimal data Invalid Invalid False
31
(1.5, 2.5, …) choice choice
3 User
input ID
and
name of
student
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
Decimal data
(1.5, 2.5, …)
Invalid
choice
Invalid
choice
False
4 User
input ID
grade of
student
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
Decimal data
(1.5, 2.5, …)
Invalid
choice
Invalid
choice
Pass
Figure 33. Test case
Test evaluation:
After testing 4 cases Id, I have 14 Pass results and 1 Fail result. According to me running the
program, when entering a decimal number, the data will be rounded by increasing the number
of the variable number value by 1 unit. For example, when passing the number 1.1 to the
number variable, the program allows the user to enter the information of 2 students. Basically,
I'm pretty confident that the algorithm's programming is pretty clear and concise with
programs that include similar functions. From the perspective of Coding Standards, my
program has the following advantages:
Follow the rules of brackets ("{...}")
Use the correct format of for, do while, while, break and if else functions.
Follow the One Statement Per Line rule.
Do not write code longer than 78 characters for optimal display
Comments are short, easy to understand, fulfill the task of explaining the code, do not
make the code more verbose and confusing.
32
3 User
input ID
and
name of
student
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
Decimal data
(1.5, 2.5, …)
Invalid
choice
Invalid
choice
False
4 User
input ID
grade of
student
Try to input
boundary data,
typical data
and bad data
Letters,
characters (a,
%, #…)
Invalid
choice
Invalid
choice
Pass
Typical data Data
accepted
Data
accepted
Pass
Boundary data
(99,
-20, …)
Invalid
choice
Invalid
choice
Pass
Bad
data(statement
)
Invalid
choice
Invalid
choice
Pass
Decimal data
(1.5, 2.5, …)
Invalid
choice
Invalid
choice
Pass
Figure 33. Test case
Test evaluation:
After testing 4 cases Id, I have 14 Pass results and 1 Fail result. According to me running the
program, when entering a decimal number, the data will be rounded by increasing the number
of the variable number value by 1 unit. For example, when passing the number 1.1 to the
number variable, the program allows the user to enter the information of 2 students. Basically,
I'm pretty confident that the algorithm's programming is pretty clear and concise with
programs that include similar functions. From the perspective of Coding Standards, my
program has the following advantages:
Follow the rules of brackets ("{...}")
Use the correct format of for, do while, while, break and if else functions.
Follow the One Statement Per Line rule.
Do not write code longer than 78 characters for optimal display
Comments are short, easy to understand, fulfill the task of explaining the code, do not
make the code more verbose and confusing.
32
Secure Best Marks with AI Grader
Need help grading? Try our AI Grader for instant feedback on your assignments.
2. Evaluation how to solve problems from algorithms
With the algorithms I presented above. To turn it into a programming language such as C#
here is also very simple. With the first words capitalized, it will be a statement or expression
calculation expression. For example, “SET” is a value assignment, REPEAT-UNTIL is a do-
while loop. In addition to some steps, there are also small steps inside to show the relationship
of the block. The algorithms I use such as compare, sort, etc. are described in detail so that
when converted into code it will be easier.
To sum up everything that has been stated so far, all of the basic conditions successfully
fulfilled and enforced by the problematic requires. In addition, separate test cases were
required for the software to ensure that it did not work incorrectly, or that it did not yield
unintended outcomes. Although several defects have occurred during the implementation
phase, the software will in future be improved and upgraded.
Going through the business problem, the code breakdown and the result of code execution. I
think it’s time to make a deeper analysis and evaluate the problem even more. With the help
of algorithms, it genuinely helps create a habit which I never think about, that constructs a
solid plan of step-by-step solutions that can slowly make coding ideas appear. Furthermore,
drawing schedules helps generate theories for challenges, like: flowcharts or user diagrams.
Combined with all this, they allow me to seamlessly code the software using lightning bolt
designs and ideas.
From that, the solution came out to be exactly as the definition of algorithms. Besides, the
switch...case condition statement and the do...while iteration statement played great role of
taking orders repeatedly. I consider that the taking orders application can be better if I have
more experience of coding.
VI. Conclusion
In summary, in the assignment I proceeded to explain using examples, how algorithms are
used to solve simple business problems and the necessary steps to follow to create a solution.
program works. the knowledge from researching about algorithms has really changed my
mind about algorithms. I once considered algorithms only engage to math or programming.
Now, my mindset is clearly open up those algorithms are everywhere, even in simple problem
in our daily lives. They really do the big job in helping people to find the best solution and
instruction to that.
VII. References
33
With the algorithms I presented above. To turn it into a programming language such as C#
here is also very simple. With the first words capitalized, it will be a statement or expression
calculation expression. For example, “SET” is a value assignment, REPEAT-UNTIL is a do-
while loop. In addition to some steps, there are also small steps inside to show the relationship
of the block. The algorithms I use such as compare, sort, etc. are described in detail so that
when converted into code it will be easier.
To sum up everything that has been stated so far, all of the basic conditions successfully
fulfilled and enforced by the problematic requires. In addition, separate test cases were
required for the software to ensure that it did not work incorrectly, or that it did not yield
unintended outcomes. Although several defects have occurred during the implementation
phase, the software will in future be improved and upgraded.
Going through the business problem, the code breakdown and the result of code execution. I
think it’s time to make a deeper analysis and evaluate the problem even more. With the help
of algorithms, it genuinely helps create a habit which I never think about, that constructs a
solid plan of step-by-step solutions that can slowly make coding ideas appear. Furthermore,
drawing schedules helps generate theories for challenges, like: flowcharts or user diagrams.
Combined with all this, they allow me to seamlessly code the software using lightning bolt
designs and ideas.
From that, the solution came out to be exactly as the definition of algorithms. Besides, the
switch...case condition statement and the do...while iteration statement played great role of
taking orders repeatedly. I consider that the taking orders application can be better if I have
more experience of coding.
VI. Conclusion
In summary, in the assignment I proceeded to explain using examples, how algorithms are
used to solve simple business problems and the necessary steps to follow to create a solution.
program works. the knowledge from researching about algorithms has really changed my
mind about algorithms. I once considered algorithms only engage to math or programming.
Now, my mindset is clearly open up those algorithms are everywhere, even in simple problem
in our daily lives. They really do the big job in helping people to find the best solution and
instruction to that.
VII. References
33
Anon., 2017. Unit 1 - Problem solving with algorithm. [Online]
Available at: https://www.slideshare.net/rajkumar1631010038/unit-1problem-solving-with-
algorithm
[Accessed 5 10 2021].
Dubey, S. K. a. P., 2013. SOFTWARE_DEVELOPMENT_LIFE_CYCSDLC ANALYTICAL
COMPARISON AND SURVEY ON TRADITIONAL AND AGILE METHODOLOGY. [Online]
Available at:
https://www.researchgate.net/publication/319716548_SOFTWARE_DEVELOPMENT_LIFE
_CYCLE_SDLC_ANALYTICAL_COMPARISON_AND_SURVEY_ON_TRADITIONAL_
AND_AGILE_METHODOLOGY
[Accessed 10 10 2021].
Mahdi, A. y., 2013. ALGORITHM AND FLOW CHART | Lecture 1. [Online]
Available at: https://faradars.org/wp-content/uploads/2015/07/Algorithm-and-Flow-Chart.pdf
[Accessed 29 9 2021].
Tutorial, D. S., December 04, 2020. What is algorithm and characteristics of good algorithm.
[Online]
Available at: https://www.codingtutorial4u.com/2020/12/what-is-algorithm-and-
characteristics.html
[Accessed 29 9 2021].
Ullman, A. A. a. J., 2021. Computer Science. [Online]
Available at: https://ncert.nic.in/textbook/pdf/kecs104.pdf
[Accessed 4 10 2021].
34
Available at: https://www.slideshare.net/rajkumar1631010038/unit-1problem-solving-with-
algorithm
[Accessed 5 10 2021].
Dubey, S. K. a. P., 2013. SOFTWARE_DEVELOPMENT_LIFE_CYCSDLC ANALYTICAL
COMPARISON AND SURVEY ON TRADITIONAL AND AGILE METHODOLOGY. [Online]
Available at:
https://www.researchgate.net/publication/319716548_SOFTWARE_DEVELOPMENT_LIFE
_CYCLE_SDLC_ANALYTICAL_COMPARISON_AND_SURVEY_ON_TRADITIONAL_
AND_AGILE_METHODOLOGY
[Accessed 10 10 2021].
Mahdi, A. y., 2013. ALGORITHM AND FLOW CHART | Lecture 1. [Online]
Available at: https://faradars.org/wp-content/uploads/2015/07/Algorithm-and-Flow-Chart.pdf
[Accessed 29 9 2021].
Tutorial, D. S., December 04, 2020. What is algorithm and characteristics of good algorithm.
[Online]
Available at: https://www.codingtutorial4u.com/2020/12/what-is-algorithm-and-
characteristics.html
[Accessed 29 9 2021].
Ullman, A. A. a. J., 2021. Computer Science. [Online]
Available at: https://ncert.nic.in/textbook/pdf/kecs104.pdf
[Accessed 4 10 2021].
34
1 out of 36
Related Documents
Your All-in-One AI-Powered Toolkit for Academic Success.
+13062052269
info@desklib.com
Available 24*7 on WhatsApp / Email
Unlock your academic potential
© 2024 | Zucol Services PVT LTD | All rights reserved.