Download Programming Assignment 1: Sorting Numbers in a List and more Assignments C Sharp Programming in PDF only on Docsity!
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 Phan Minh Tri Student ID GCD Class GCD0904 Assessor name Hoang Nhu Vinh 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 D
Summative Feedback: Resubmission Feedback:
Grade: Assessor Signature: Date: Lecturer Signature:
Table of Contents
- Chapter 1 - Stage your simple business problems to be solved....................................................................................
- I. Overview about Algorithm
- II. Represent a small and simple problem
- Chapter 2 - Analyze the problem and design the solutions by the use of suitable methods
- I. Analyze the problem
- II. Flowchart
- Chapter 3 - Demonstrate the complication and running of a program
- I. Introduce how the problem is solved................................................................................................................
- II. Source code and screen shots of the final result
- III. Explain briefly what is Software Development Life Cycle
- IV. Explain how the source code is complied
- Figure 1: algorithm Table of Figures
- Figure 2: Example of algorithm
- Figure 3: Flowchart of the problem...............................................................................................................................
- Figure 4: Source code
- Figure 5: Result of the example.....................................................................................................................................
- Figure 6: Software (or Program) Development Life Cycle
- Figure 7: Problem analysis.............................................................................................................................................
- Figure 8: Process of complier
Chapter 1 - Stage your simple business problems to be solved I. Overview about Algorithm
- Definition: An algorithm is step-by-step description of the solution to a problem. Figure 1 : algorithm
- An algorithm must be
- Define
- Finite
- Precise and effective
- Implementation independent
- Example of sum of two numbers: The algorithm includes:
- Start
- Read two numbers A and B
- Assign Sum = A + B
- Print Sum
- End Figure 2 : Example of algorithm
Chapter 3 - Demonstrate the complication and running of a program I. Introduce how the problem is solved
- The Sort of List method uses the ‘CompareTo’ method, which relies on the return value to determine the order of two adjacent numbers when compared.
- This method uses the previous number minus the next number to identify the position of the two numbers to be compared.
- A return value less than 0 indicates that the current object is smaller (or precedes) the other object. If the return value is 0, the two objects are equal, and if it is greater than 0, the current object is greater than (or behind) the other object.
- Example:
- Enter the length of list - > in this example, I will input 3 is length of the list
- Enter 3 numbers 5 2 9 - > Program will read 3 numbers
- The program compares the first two numbers (in positions [0] and [1]) is 5 and 2
- Because 5 – 2 = 3 > 0 - > the program will swap the position of 2 numbers - > 2 5 9
- The program compares to the next number (in positions [1] and [2] after swap) is 5 and 9
- Because 5 – 9 = - 4 < 0 - > the program will keep the position of 2 numbers
- The list of numbers after sorting is 2 5 9 II. Source code and screen shots of the final result Figure 4 : Source code
Figure 5 : Result of the example III. Explain briefly what is Software Development Life Cycle ❖ Definition: Software (or Program) Development Life Cycle is a methodical approach to creating high-quality applications. Each step of program development must be effectively completed before going on to the next one, according to a detailed roadmap. (SakshiBhakhra, 2019) Figure 6 : Software (or Program) Development Life Cycle
Figure 8 : Process of complier
- So, for a compiled language, the translation from source code to machine executable code occurs before the program is executed. An interpreted programming language uses a separate method. (ICS111, 2021) References ICS111, 2021. The Programming Process. [Online] Available at: http://www2.hawaii.edu/~takebaya/ics111/process_of_programming/process_of_programming.html [Accessed 20 August 2021]. SakshiBhakhra, 2019. Software Engineering | Program Development Life Cycle (PDLC). [Online] Available at: https://www.geeksforgeeks.org/software-engineering-program-development-life-cycle-pdlc/ [Accessed 20 August 2021].