Visual programming for freshman, Exams of Compilers

Visual programming for freshman. You will be able to use C# skillfully

Typology: Exams

2020/2021

Uploaded on 05/10/2021

jackie-ming
jackie-ming 🇬🇧

8 documents

1 / 12

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
Higher Nationals in Computing
Programming
ASSIGNMENT
No.1
Learner’s Name: DOAN THANH DUNG
Assessor Name: NGUYEN VAN SON
Class: 1618 GCS0901
ID: GCS200419
Assignment due:
Assignment submitted:
pf3
pf4
pf5
pf8
pf9
pfa

Partial preview of the text

Download Visual programming for freshman and more Exams Compilers in PDF only on Docsity!

Higher Nationals in Computing

Programming

ASSIGNMENT

No.

Learner’s Name: DOAN THANH DUNG

Assessor Name: NGUYEN VAN SON

Class: 1618 GCS

ID: GCS

Assignment due:

Assignment submitted:

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 Đoàn Thanh Dũng Student ID GCS 200419 Class GCS0901 Assessor name Nguyễn Văn Sơn 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 Dũng Grading grid P1 M1 D

❒ Summative Feedback: ❒ Resubmission

Feedback: Grade: Assessor Signature: Date: Lecturer Signature:

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) using a menu based program. Tasks:

  1. State your simple business problems to be solved.
  2. Analyse the problem and design the solutions by the use of suitable methods.
  3. Demonstrate the compilation and running of a menu-based program
  4. Evaluate how the problem is solved from the designed algorithm to the execution program written by a specific programming language. You also need to do a presentation of your work (it should be summary of your report). Learning Outcomes and Assessment Criteria Pass Merit Distinction LO1 Define basic algorithms to carry out an operation and outline the process of programming an application 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.

Guideline

  • Assignment
    1. Algorithm and outline the process in building an application (P1)
    • 1.1.1. Algorithm
    • 1.1.2. Outline the process in building an application
    1. The steps taken from writing code to execution (M1)
    • 2.1.1. Defining or Analyzing the problem
    • 2.1.2. Design (Algorithm)
    • 2.1.3. Coding
    • 2.1.4. Documenting the program
    • 2.1.5. Compiling and running the program
    • 2.1.6. Testing and Debugging
    • 2.1.7. Maintenance
    1. Examine the implementation of an algorithm in a suitable language. (D1)
    • 3.1. Problem description
    • 3.2. Analysis
    • 3.3. Implementation (using C#)
    • 3.4. Run and test
    1. Evaluate the relationship between the written algorithm and the code variant (D1)
    1. Referrences

2. The steps taken from writing code to execution (M1)

2.1.1. Defining or Analyzing the problem

Defining the problem before writing the app helps us easy to understand the case, also investigating the problem let you know the ways on how to complete the app. Defining the problem before writing the app helps us easy to understand the case, also investigating the problem let you know the aspect on how to complete the app.

2.1.2. Design (Algorithm)

After knowing what specific tasks you are going to do, the design part will be the next thing that we need to do. Drawing Use-Case diagram, flowchart, pseudo code are three of the most likely we all use. A UML use case diagram is the primary form of system/software requirements for a new software program underdeveloped. Use cases specify the expected behavior (what), and not the exact method of making it happen (how). Use cases once specified can be denoted both textual and visual representation (i.e. use case diagram). A key concept of use case modeling is that it helps us design a system from the end user's perspective. It is an effective technique for communicating system behavior in the user's terms by specifying all externally visible system behavior [2]. In general, the use case diagram shows the relationship between actor, system, cases. A flowchart is a type of diagram that represents a workflow or process. A flowchart can also be defined as a diagrammatic representation of an algorithm, a step-by-step approach to solving a task. [3] The last thing is pseudo-code is a plain language description of the steps in an algorithm or another system. Pseudocode often uses structural conventions of a normal programming language but is intended for human reading rather than machine reading. [4]

2.1.3. Coding

In this stage, coding is the part of writing the program. We use all the algorithms that we analyzed and designed to construct and give logical form to the program.

2.1.4. Documenting the program

The document needs to explain how the program work which is known as the user manual, also the document have to show confused or easy forgotten pieces of the program for the users can handle it. The maintenance manual is needed in the documentation.

2.1.5. Compiling and running the program

In computing, a compiler is a computer program that translates computer code written in one programming language (the source language) into another language (the target language).

The name "compiler" is primarily used for programs that translate source code from a high- level programming language to a lower level language (e.g., assembly language, object code, or machine code) to create an executable program. [5] While the program is executed, the computer’s memory loads the program. During this stage, the user can start testing and debugging the program.

2.1.6. Testing and Debugging

Testing is the process of executing the program to find out if the output matches the required, also it shows us whether the program following the process of flowchart and pseudo-code. During this process, the user may find issue(s) and start debugging to make the program to be qualified.

2.1.7. Maintenance

Maintenance is the continuing process of modifying the program. It helps the program can easily be adapted to the changing requirement and technologies. In this stage of running the program, we need to follow the standards of coding (the naming, symbol, comments, etc.) which makes it easier for later users to use and maintain the program, also the maintaining part in the program document is usable for the user keeping up the program.

3. Examine the implementation of an algorithm in a suitable language. (D1) Using algorithms help you find solutions quickly for your problem. The art of using the algorithm is wondrous, in any cases algorithm is followed by: Knowing what you are dealing with: seeing the problem clearly and surely helps you reduce the time of designing and coding. Note the problem: A pen and paper is suitable for this type of task. Writing down all the list of your problems and break them into parts to solve them. Design: create flow for your program in order Variable: Decide what data structure you are going to use and storing it for better performance. Programing language: Translate each line of the case into programing language (pseudo-code is handy for this situation). You are translating human language into the programming language.

Pseudo-code: Step1: Start. Step2: Declare variables n, fact, i. Step3: Set fact =1 and i=1. Step4: Input n from the keyboard. Step5: if n=0: True: Step5.1: set fact=1. Step5.2: Go to step7. False: Step5.1: Go to step6. Step6: if I <= n: True: Step6.1: Set fact = fact*I then i=i+1. Step6.2: Go to step6. False: Step6.1: Go to step7. Step7: Print fact to the screen. Step8: End.

3.3. Implementation (using C#)

Code:

3.4. Run and test

Output : Test table: Number Test case step Expected output Actual output Result 1 Validate n Input positive n = 3 Factorial number of 3 is 6 Factorial number of 3 is 6 Pass 2 Validate n Input n= Factorial number of 0 is 1 Factorial number of 0 is 1 Pass 3 Invalidate n Input negative n=- 3 Program will ask to enter n again: “Enter n to process: “ Enter n to process: Pass

4. Evaluate the relationship between the written algorithm and the code variant (D1) Algorithm and code are two separate fields. The algorithm can be used in any type of language and can be written in any programming language. Because the algorithm is the way how we can solve the problem to get the answer. On the other hand code variant is the set of programming language for the computer to understand, it can only be written down if we have the algorithm to describe what we need to do in order to process. 5. Referrences [1] M ALAN , D., 2021. W HAT ' S A N A LGORITHM? - D AVID J. M ALAN. [ ONLINE ] TED-E D. A VAILABLE AT : < HTTPS :// ED. TED. COM / LESSONS / YOUR - BRAIN - CAN - SOLVE - ALGORITHMS - DAVID - J - MALAN # DIGDEEPER > [A CCESSED 26 J ANUARY 2021].