Assignment 1-Programming-1618, Assignments of C programming

Pass Pass Pass Pass Pass Pass Pass Pass Pass

Typology: Assignments

2021/2022

Uploaded on 03/23/2023

trantuantd14
trantuantd14 🇻🇳

4.3

(4)

25 documents

1 / 23

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 1 FRONT SHEET
Qualification
BTEC Level 5 HND Diploma in Computing
Unit number and title
Unit 1: Programming
Submission date
21st of December 2021
Date Received 1st submission
Re-submission Date
Date Received 2nd submission
Student Name
Tran Anh Tuan
Student ID
GCD201675
Class
GED1001
Assessor name
Do Duy Thao
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
Tuan
Grading grid
P1
M1
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17

Partial preview of the text

Download Assignment 1-Programming-1618 and more Assignments C 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 21 st^ of December 2021 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Tran Anh Tuan Student ID GCD Class GED1001 Assessor name Do Duy Thao 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 Tuan Grading grid P1 M1 D

 Summative Feedback:  Resubmission Feedback: Grade: Assessor Signature: Date: Lecturer Signature:

  • Chapter 1. State your simple business problems to be solved
      1. Overview about Algorithm
      1. Represent a small and simple problem
  • Chapter 2. Analyse the problem and design the solutions by the use of suitable methods
      1. Analyse the problem
      1. Flowchart
  • Chapter 3. Demonstrate the compilation and running of a program
      1. Introduce how the program is solved and screen shots source code of the result
      1. Result of menu function
      1. Explain briefly what Software Development Life Cycle
  • execution program written by a specific programming language Chapter 4. Evalutate how the problem is solved from the designed algorithm to the
      1. Include Test cases
      • 1.1. Test schedule
      • 1.2. Testing and result
    • program written by a specific programming language 2. Evaluate how the problem is solved from the designed algorithm to the execution
  • Chapter 5. References
  • Figure 1. An example about an algorithm Table of Figure
  • Figure 2. C# language..........................................................................................................
  • Figure 3. Variable
  • Figure 4. Input information
  • Figure 5. Print information
  • Figure 6. Main
  • Figure 7. Result of menu function
  • Figure 8. Result of option
  • Figure 9. Result of option

Chapter 1. State your simple business problems to be solved

1. Overview about Algorithm

Algorithms give us the most ideal option of accomplishing a task to improve the efficiency of a computer program, proper utilization of resources. What algorithm mean?

  • An algorithm is a finite sequence of well-defined, computer-implementable instructions, typically to solve a class of specific problems or to perform a computation.
  • Algorithms are always unambiguous and are used as specifications for performing calculations, data processing, automated reasoning, and other tasks. In contrast, a heuristic is a technique used in problem solving that uses practical methods and/or various estimates in order to produce solutions that may not be optimal but are sufficient given the circumstances.

2. Represent a small and simple problem

Firstly, I will introduce the C# language, it used in algorithm to solved problem Figure 2. C# language

  • C# is a general object-oriented programming (OOP) language for networking and Web development. C# is specified as a common language infrastructure (CLI) language.
  • In January 1999, Dutch software engineer Anders Hejlsberg formed a team to develop C# as a complement to Microsoft’s NET framework. Initially, C# was developed as C-Like Object Oriented Language (Cool). The actual name was changed to avert potential trademark issues. In January 2000, NET was released as C#. Its NET framework promotes multiple Web technologies.

Chapter 2. Analyse the problem and design the solutions by the

use of suitable methods

1. Analyse the problem

There is a basic example of a problem that can solve by an algorithm.

  • A teacher wants to manage the grades of his class. He asks you to help him to create a small application to manage them. He needs to enter the name, ID, grade of the students. Then he needs to print information and grade together.
  • After read clearly the scenario, I solved it by using an algorithm based on C# language to create a program must have full option that satisfy the requirement of teacher. We need to create an application to enter name, score, ID.

2. Flowchart

Flowchart 1. Main of application

Flowchart 2. Menu list of application Explain (pseudo code): Step 1: START Step 2: PRINT (“Input total student (3-30)”) Step 3: PRINT (“1. Input information”) Step 4: PRINT (“2. Show information”) Step 5: PRINT (“3. Exit”) Step 6: PRINT (“Input your choice”)

Option 1. Input information of students Explain (pseudo code): Step 1: START Step 2: DECLARE the variable i Step 3: Input n Step 4: WHILE n < 3 | n > 30 is true, return step 3 Step 5: SET i = 0 Step 6: WHILE I < n is true, repeat 8 through step 11

Explain (pseudo code) Step 1: START Step 2: DECLARE the variable i Step 3: SET i = 0 Step 4: WHILE i < n is true, repeat step 5 through step 6 Step 5: PRINT ID[i], grade[i], name[i] Step 6: MOVE UP i by 1 Step 7: STOP

Chapter 3. Demonstrate the compilation and running of a

program

1. Introduce how the program is solved and screen shots source code of the

result

The solution here is I use functions called “switch-case”, each of which has an algorithm to process the program. And the program use “do-while” function to check the condition. Firstly, I create variables that using strings to store information into arrays, using integer “I” for “for-loop” functions, using integer “n” to get total of students, using Boolean to check and “k” for “switch-case”. Figure 3. Variable

Void 1. Input information Figure 4. Input information I used the “for-loop” function and I used the while-loop structure here, if the grade is less than 0 and more than 10, it will force the user to reenter, because the point ladder always starts from 0→10. So, if the user enters the right grade, it will move to enter IDs.

Void 3. Main Figure 6. Main

I start with “Input total students(3-30)” and SET the “do-while” is (n<3 or n> 30). After that I print the menu list has all of things that teacher needs. In the “switch-case” ➢ Case 1 is mandatory, run Input () function, after that, assign check=true and return to the menu ➢ If user choose case 2, it will run showinfo () function, it happens if user input case 1 first. Finish case 2, return to the menu. ➢ Then in the case 3, it is the way to quit this application.

2. Result of menu function

Figure 7. Result of menu function After enter 3 students Example: When you select option 2, you will get a list of all student IDs and grades

When the user chooses option 2, the program will display on the screen all the student’s information including the student’s grade and ID Figure 9. Result of option 2 Show information

3. Explain briefly what Software Development Life Cycle

Software Development Life Cycle (SDLC) is a process used by the software industry to design, develop and test high quality software’s. The SDLC aims to produce a high-quality software that meets or exceeds customer expectations, reaches completion within times and cost estimates. ➢ SDLC is the acronym of Software Development Life Cycle. ➢ It is also called as Software Development Process. ➢ SDLC is a framework defining tasks performed at each step in the software development process. ➢ ISO/IEC 12207 is an international standard for software life-cycle processes. It aims to be the standard that defines all the tasks required for developing and maintaining software

Chapter 4. Evalutate how the problem is solved from the designed

algorithm to the execution program written by a specific

programming language

1. Include Test cases

1.1. Test schedule Test case Start date End date Intend time (hour) 1 21/12/2021 21/12/2021 1 2 21/12/2021 21/12/2021 1 3 21/12/2021 21/12/2021 1