Docsity

Programming - 1618 - Grade D, Assignments of Computer Programming

Toggle sidebar
bg1
ASSIGNMENT 1 FRONT SHEET
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and title Unit 1: Programming
Submission date 08/09/2022 Date Received 1st submission
Re-submission Date Date Received 2nd submission
Student Name Student ID
Class Assessor name
Đặng Trần Long
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 Tung
Grading grid
P1 M1 D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24

Partial preview of the text

Download Programming - 1618 - Grade D and more Assignments Computer 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 08/09/2022 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Student ID Class Assessor name Đặng^ Trįŗ§n^ Long 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 Tung Grading grid P1 M1 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

1.3.File Program.cs......................................................................................... 18 1.3.1.......................................................................................................Declare variable and array......................................................................... 19 1.3.2.......................................................................................................Select menu function............................................................................... 19 1.3.3.......................................................................................................Input student’s information....................................................................................... 20 1.3.4.......................................................................................................Print student’s information....................................................................................... 20 1.3.5.......................................................................................................Print the student with the highest / lowest grade......................................... 21 1.3.6.. Search for the student with the matching ID.............................. 23 1.3.7.......................................................................................................Removing a student inside the student list.................................................... 24 1.3.8.......................................................................................................Sorting student by grade descending / ascending..................................... 25 1.3.9.......................................................................................................Exiting the program......................................................................................... 27

  1. Result............................................................................................................... 27 2.1.Input student’s information.......................................................................................... 27 2.2.Print out student’s information................................................................................... 28 2.3.Display the student with the highest grade / lowest grade....................... 28 2.4.Search for the student though student’s ID.......................................................... 29 2.5.Remove a student in student list.............................................................. 29 2.6.Sorting student by grade descending / ascending.................................... 30 2.7.Exit the program....................................................................................... 30 III. Examine the implementation of an algorithm in a suitable language. Evaluate the
  • Introduction.............................................................................................................................................
      1. Overview about Algorithm..................................................................................
      • 1.1.Definition of algorithms…..............................................................................................
      • 1.2.How do computer algorithms work?….....................................................................
      • 1.3.Example......................................................................................................
      1. Characteristic algorithm...........................................................................................................
      • 2.1.How problem is solved...............................................................................
      • 2.2.Source code and screenshots....................................................................
      1. Software Development Life Cycle (SDLC)..........................................................
      • 3.1.What is SDLC?............................................................................................
      • 3.2.Represent a small and simple problem.....................................................
      • 3.3.Analyze the problem..................................................................................
      • 3.4.Activity Diagrams......................................................................................
      • 3.5.Flowchart...................................................................................................
  • M1. Determine the steps taken from writing code to execution...............................
      1. Source code.....................................................................................................
      • 1.1.Declare variable and array........................................................................
      • 1.2.Select menu function................................................................................
  • relationship between the written algorithm and the code variant.........................
      1. Test Case........................................................................................................
      1. Evaluate.........................................................................................................
  • REFERENCES..........................................................................................................

1.3. Example A search engine is an algorithm that takes a search query as an input and searches its database for items have the same value to the input in the query. It then outputs the results. Input:

  • Number of student info to store in the array
  • Student information
  • The student ID the user wants to search information from Output:
  • An integer the user was searching for Procedures step by step: ļ‚· Create variable i = 0 ļ‚· Declare variable stdNums ļ‚· Input number of student user wants to store in the array, store in stdNums ļ‚· Declare array int stdId[stdNums], float grade[stdNums] ļ‚· Using for loop, if i < stdNums, i++ ļ‚· Read student ID: stdId[ i ], student grade: grade[ i ] ļ‚· Create variable count = 0 ļ‚· Input student ID the user wants to search, read search ļ‚· Using for loop, if i < stdNums, i++ ļ‚· if search == stdId[ i ], print out student ID: stdId[ i ], student grade: grade[ i ], count+

ļ‚· if count == 0, print out "Student ID is not exist." The result after running through the algorithm above is the information of the student that ID was entered or empty if the program can’t find any matching ID.

Flowchart of find the search number algorithm

2. Characteristics algorithm ļ‚· Input: These are the value can be process by the algorithm, there could be multiple input depend on the program. ļ‚· Output: The output is the data resulting from the computation (intended result). An algorithm should have 1 or more outputs, and should match the desired output. ļ‚· Variable used in the program: o Int stdNums: number of student info to store in the array o Int array stdId: store list of student ID in an array o Int array grade: store list of student grade in an array o Int search: number the user entered to check if it matchs with student ID o Int count: count the number of student with an match ID

2.2.Source code and screenshots....................................................................

Source code

Explanation: ļ‚· First, the application will ask for how many students user want to add and read that value, save it to an integer value stdNums. Then declare and int array studentId and float array grade to store student information. ļ‚· Secondly, the application will run a for loop base on the number of students added and takes student ID and grade input from user, add them to the two arrays created above. ļ‚· Next, the application will ask the ID of the student the user want to search for and read that value. An integer also creates to count the number of students with match ID. ļ‚· Finally, the application run the same loop as above to check if the student ID is matched. If the condition is met it prints out the student information, otherwise it will print "Student ID is not exist."

3. Software Development Life Cycle (SDLC)..........................................................

3.1. What is SDLC? SDLC is a process followed for a software project, within a software organization. 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. Stage 1: Planning and Requirement Analysis Requirement analysis is the most important and fundamental stage in SDLC. It is performed by the senior members of the team with inputs from the customer, the sales department, market surveys and domain experts in the industry. This information is then used to plan the basic project approach and to conduct product feasibility study in the economical, operational and technical areas. Planning for the quality assurance requirements and identification of the risks associated with the project is also done in the planning stage. The outcome of the technical feasibility study is to define the various technical approaches that can be followed to implement the project successfully with minimum risks.

Stage 2: Defining Requirements Once the requirement analysis is done the next step is to clearly define and document the product requirements and get them approved from the customer or the market analysts. This is done through an SRS (Software Requirement Specification) document which consists of all the product requirements to be designed and developed during the project life cycle. Stage 3: Designing the Product Architecture SRS is the reference for product architects to come out with the best architecture for the product to be developed. Based on the requirements specified in SRS, usually more than one design approach for the product architecture is proposed and documented in a DDS - Design Document Specification. This DDS is reviewed by all the important stakeholders and based on various parameters as risk assessment, product robustness, design modularity, budget and time constraints, the best design approach is selected for the product. A design approach clearly defines all the architectural modules of the product along with its communication and data flow representation with the external and third- party modules (if any). The internal design of all the modules of the proposed architecture should be clearly defined with the minutest of the details in DDS. Stage 4: Building or Developing the Product In this stage of SDLC the actual development starts and the product is built. The programming code is generated as per DDS during this stage. If the design is performed in a detailed and organized manner, code generation can be accomplished without much hassle. Developers must follow the coding guidelines defined by their organization and programming tools like compilers, interpreters, debuggers, etc. are used to generate the code. Different high-level programming languages such as C, C++, Pascal, Java and PHP are used for coding. The programming language is chosen with respect to the type of software being developed. Stage 5: Testing the Product This stage is usually a subset of all the stages as in the modern SDLC models, the testing activities are mostly involved in all the stages of SDLC. However, this stage refers to the testing only stage of the product where product defects are reported, tracked, fixed and retested, until the product reaches the quality standards defined in the SRS.

3.5. Flowchart Flowchart of the program

II. Determine the steps taken from writing code to execution.

1. Source code.....................................................................................................

1.1.Create Student class in file Student.cs This class include variable: ļ‚· String stuId: store student Id ļ‚· String name: store student name ļ‚· Int age: store student age ļ‚· Email: store student email ļ‚· Grade: store student average grade Each variable has getter and setter, constructor for easy access the information from the outside of the class.

The function will display request for the user to input student’s information and store them accordingly with the variable inside the class. It also will ask the user to re-entered the information if the input is not correct. At the end it will add the info into StudentList using Add()

Lastly, a function RemoveStudent(int rmv); This will simply find a student’s information at the variable rmv position in the array list and remove it. 1.3.File Program.cs 1.3.1 Declare variable and array 1.3.2. Select menu function The menu function has only one job is to print out the menu layout for the application. I have created a do – while loop and put menu function and the switch

  • case statement for the user to check the menu again after finishing a function.