











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












Qualification BTEC Level 5 HND Diploma in Computing Unit number and title Unit 1: Programming Submission date August 12, 2022 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name NGUYEN HA NHAT LINH Student ID GCC Class GCC1002^ Assessor name NGUYEN^ HUNG DUNG 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 LINH Grading grid P1 M1 D
Grade:
Assessor Signature:
Date: Lecturer Signature:
● Make sure that you understand and follow the guidelines to avoid plagiarism. Failure to comply this requirement will result in a failed assignment. Unit Learning Outcomes: LO1 Define basic algorithms to carry out an operation and outline the process of programming an application Assignment Brief and Guidance: Assignment scenario You have applied for a post as a trainee with a software development company and have been invited for an interview. You have been asked to demonstrate your problem solving and basic programming skills. To do this you have to prepare a report on using algorithms to solve problems. You need to explain, using examples, how algorithms are used to solve simple business problems and the steps needed to be followed to produce a working program solution. You should make clear your assumption about your program. The problems to be solved will involve basic procedural programming instructions - sequence instructions (input, output and assignment statements), loops, conditional statements. Problems should be analysed and designed by the use of flowchart and demonstrated by the use of modules (procedures). Tasks: State your simple business problems to be solved. Analyse the problem and design the solutions by the use of suitable methods. Demonstrate the compilation and running of a program Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language. Learning Outcomes and Assessment Criteria (Assignment 1): Learning Outcome Pass Merit Distinction LO1 (^) P1 Provide a definition of what an algorithm is and outline the process in building an application. M1 Determine the steps taken from writing code to execution. D1 Examine the implementation of an algorithm in a suitable language. Evaluate the relationship between the written algorithm and the code variant.
Definition of algorithms
Figure 2 Characteristics of an Algorithm
1. Analyze the problem 1.1. Specifying the input requirements: No Variable Data type Describe 1 n int The variable n is used to enter the total number of values that the user wants to enter into the array. 2 numbers int enter the desired value for the user to add to the "number" variable 1.2. Specifying the output requirements: No Variable Data type Describe 1 min int compare with input values and find smallest value in array 2. Specifying the processing requirements: First, the program will display a message asking the user to enter the total amount that the user wants. Next, the program will take the number that the user has just entered to check into the array. If the user enters the array as a negative number, the program will report an error and the program will immediately stop. When the user enters the correct number in the array, the chapter will be stored in the array. Then the program will make the variable "min" equal to the first element of the array "number". Next, the for loop is used to look at the elements in the array, if the value of the min variable is greater than the element of the array at position 'i', then the min variable will receive the value at that element and the loop will perform the process until the end of the loop, the min variable will receive the minimum value of the element in the
1) Demonstrate how the application is implemented source code of the program us ng System; us ng System.Collect ons.Gener c; us ng System.L nq; us ng System.Text; us ng System.Thread ng.Tasks; namespace ConsoleApp 30 { nternal class flrogram { stat c vo d Ma n(str ng[] args) { Console.Wr teL ne("Enter the number of array elements "); nt n = nt.flarse(Console.ReadL ne()); wh le (n < 2) { Console.Wr teL ne("The number of array elements must be larger than 1 !"); Console.Wr te("please enter aga n: "); n = nt.flarse(Console.ReadL ne()); } nt[] numbers = new nt[n]; for ( nt = 0; < n ; + +) { Console.Wr te("enter the th element { 0 }: ",
Figure 4. The first interface when the program launches o Next, if the user enters the number of the array as a negative number, the program will report an error and the program will ask you to re-enter it. Figure 5 the number of the array as a negative number o Next the program will ask the user to enter the correct number for the array. Figure 6 The program will ask the user to enter the correct number for the array_._ o Next the program asks the user to enter the total number of students and enter each quantity into the array.
compiled. All these errors are generally detected by the compiler and thus are known as compile-time errors. For example, missing semicolon, missing parenthesis, etc. Runtime error: Errors that occur during program execution(run-time) after successful compilation is called run-time errors. One of the most common run-time errors is division by zero also known as Division error. These types of errors are hard to find as the compiler doesn’t point to the line at which the error occurs. Step 4: Languages such as Java or C# are not directly converted or compiled into machine-level language or machine instructions. These languages need to be converted to an intermediate code first, which is a partially half compiled code. For C#, the source code is converted to an intermediate code which is known as 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 known as Common Language Runtime (CLR) which translates the CIL or IL code to native code or machine understandable code or machine instructions. This process is called the Just-In-Time (JIT) Compilation or Dynamic Compilation which is the way of compiling code during the execution of a program at run time only. Step 6: Once the C# programs are compiled, they’re 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 program grows, it is physically separated by related namespaces into separate assemblies. Assemblies typically have the file extension. exe or .dll , depending on whether they implement applications or libraries respectively, where EXE stands for Executable and DLL stands for Dynamic Link Library. An EXE (Executable) file represents a program that can be executed and a DLL (Dynamic Link Library) file includes code (Eg: Library) that can be reused across different programs. Step 7: Now, the C# compiler returns the output of the given c# code.
1 (geeksforgeeks, 2021) IV. Chapter 4 - Evaluate how the problem is solved from the designed algorithm to the executionprogram written by a specific programming language. (D) Test Plan
Index of comments 2.1 Strength