ASSIGNMENT 1 FRONT SHEET Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1 Programming Submission date 8 12 2022 Date Received 1st submission Re submission Date Date Rec.
Trang 1Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 1: Programming
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 Quang
Grading grid
Trang 2❒ Summative Feedback: ❒ Resubmission Feedback:
Lecturer Signature:
Trang 3Table of contents
1.State a simple business problem to be solved(P1) 5
1.1 what is algorithm………5
1.2 small problem needs to be solved using algorithm………5
2.Analyze the problem and design the solutions by the use of stutable methodes……….6
2.1 Analyze the problem………7
2.2 Flowchart of the algorithm………8
3 Demonstrate the compilation and running of a program………9
3.1 How problem is solved……… 9
3.2 Source code and screenshots of the program………10
3.3 What if software development life cycle and how the source code is compiled and run…….14
3.3.1 software Development life cycle………15
3.3.2 How the source code is compiled and run……… 15
References……….16
Trang 4Table of figures
Figure 1: flowchart of an algorithm………5
Figure 2: list of student to be sorted………6
Figure 3: Bubble sort……… 6
Figure 4;Flowchart of the program……….8
Figure 5: How the program solves the problem……… 9
Figure 6: Source code……….10
Figure 7: Source code ……….11
Figure 8: Source code……… 12
Figure 9: Source code……… 13
Figure 10: Source code………14
Figure 11: Running program………15
Figure 12; stages of software development life cycle……….15 Figure: programming process for a compiled programming language
Trang 51 State a simple business problem to be solved(P1)
1.1 what is algorithm
● An algorithm is a set of commands that must be followed for a computer to perform calculations or other problem-solving operations
● According to its formal definition, an algorithm is a finite set of instructions carried out
in a specific order to perform a particular task
It is not the entire program or code; it is simple logic to a problem represented as an informal description in the form of a flowchart or pseudocode
Figure 1: flowchart of an algorithm
1.2 Small problems needs to be solved using algorithms
The problem I want to present is sorting students by grades in ascending order This is a simple business problem teachers usually use to sort the list of the class It helps teachers to see the lowest and highest grade students
Trang 6Figure 2: List of students to be sorted
To solve this problem, I will use bubble sorting algorithm because it's simple
Figure 3: Bubble sort This algorithm will swap the variable if the next variable is greater than the current It does this constantly until the array is in the correct order
Trang 72 Analyze the problem and design the solutions by
the use of suitable methods
2.1 Analyze the problem
• Input: o Number of students to insert o Student information (Names/Grades) to insert
• Output: o A sorted student list
• Variable used in the program: o int n: number of student to insert a double array grade: store grades of students o string array name: store student’s names
• Structures: o while loop o for loop o if/else
2.2 Flowchart of the algorithm
Trang 8Figure 4: Flowchart of the program
Trang 93 Demonstrate the compilation and running of a program 3.1 How problem is solved
I create a console application in Visual Studio using the C# programming language to implement this algorithm
A list of students' names and grades can be entered into the application, and it can output
a sorted list
Figure 5: How the program solves the problem 3.2 Source code and screenshots of the program
Trang 10Figure 6: Source code
Explanation:
● The application will first prompt the user for the number of students they wish to add, read that value, and save it to an integer variable After that, it declares two arrays for student names and grades, respectively
Trang 11Figure 7: Source code
● Second, the software will execute a for loop based on the number of students to add, and add the user-inputted student names and grades to the two arrays already constructed
Figure 8: Source code
The bubble sort method will then be conducted by the software using two for loops The purpose of the IF structures is to determine whether the grade in the following index is lower than the one with the current index value If accurate, two grades' worth will be swapped, and so on To keep the student name and grade pair together, I must exchange the names at the same time as the grades The two variables I utilize
to temporarily store the value during the switching procedure are tempGrade and tempName
Trang 12Figure 9: Source code
• Finally, it will display the list simply by looping through the arrays using for loop
Figure 10: Source code
Screenshot of the program running:
Trang 13Figure 11: Running program
Trang 143.3.1 Software Development Life Cycle
Software Development Life Cycle is a process of developing, maintaining, replacing and altering
or enhancing a specific software The development life cycle is the core principle of improving the quality of the software as well as the overall development process
Figure 12: Stages of Software Development Life Cycle
Software Development Life Cycle contains 6 stages:
• Planning o Analyzing the user’s requirements and planning for the quality assurance requirements This stage is implemented by the senior members of the team, the sales department, market surveys and domain experts
• Defining o Define the product requirements and get them approved by the customer
• Designing o Design the architecture of the product, determine how the data will flow or the
communication between the product and external, third-party modules
Trang 15• Developing (Building) o The programmers (developers) will write the program based on the design and requirements above
• Testing o Tester or programmer will test the product, find bugs and debugging
• Deploying o At this stage, the final, stable version of the product will be released (Anon., n.d.)
3.3.2 How the source code is compiled and run
The compiler takes the source code and translates it into a machine language module (called an object file) Next, linker will combine this object file with other previously compiled object files (in particular run-time modules) to create an executable file (Anon., n.d.)
Test plan:
References
(-simplilearn, https://www.simplilearn.com/tutorials/data-structure-tutorial/what-is-an-algorithm, accessed
28/11/2022)
Available at: ( https://www.tutorialspoint.com/sdlc/sdlc_overview.htm ) [Accessed 28/11/ 2022]
Trang 16ml ) [Accessed 25 April 2022]