Programming Fundamentals: Algorithm Design and Implementation in C#, Assignments of C programming

Pass Pass Pass Pass Pass Pass Pass Pass Pass Pass Pass

Typology: Assignments

2020/2021

Uploaded on 09/10/2021

imissyou
imissyou 🇻🇳

4.6

(33)

9 documents

1 / 16

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
Date Received 1st submission
Re-submission Date
Date Received 2nd submission
Student Name
Đinh Xuân Trường
Student ID
GCH200308
Class
GCH0908
Assessor name
Lại Mạnh Dũng
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
Trường
Grading grid
P1
M1
D1
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff

Partial preview of the text

Download Programming Fundamentals: Algorithm Design and Implementation in C# 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 Date Received 1st submission Re-submission Date Date Received 2nd submission Student Name Đinh Xuân Trường Student ID GCH Class GCH0908 Assessor name Lại Mạnh Dũng 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 Trường Grading grid P1 M1 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

I. 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 MEANS? 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.

An example about an algorithm

2) Represent a small and simple problem

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

Main of application Explain (pseudo code): Step 1: START Step 2: DECLARE the variable n, ID[], grade[], name[], flag Step 3: SET flag=false Step 4 : Print menu Step 5: Input option Step 6 : If option=1 then Step 6 .1: Call input() Step 6 .2: SET check=true Step 6 : ELSE (check=false) is true, return Step 4. Step 7 : IF option=2 then CALL showInfo()

Step 8 : WHILE option != 3 , repeat Step 3 Step 9 : STOP 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: “) Step 7 : STOP

Step 8: READ name[i] Step 9: READ ID[i] Step 10: READ grade[i] Step 11: WHILE (grade[i]<0 or grade[i]>10) is true, return Step 10 Step 12: MOVE UP i by 1 Step 13: STOP Option 2: Print information of students Explain (pseudo code): Step 1: START Step 2: DECLARE the variable i

Step 3: SET i= 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 III. 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”. Void 1 : Input information

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. Or not, it will print to screen “You must input information first.” To make it work, I used if-else structure to control it. Finish case 2, return to the menu.
  • Then in the case 3, it is the way to quit this application.

2) Console

After enter 3 students

After enter information of students

V. REFERENCES (Wiki, n.d.) https://en.wikipedia.org/wiki/Algorithm ALGORITHM (https://www.techopedia.com/definition/26272/c-sharp) C SHARP MEANING (https://www.tutorialspoint.com/sdlc/sdlc_overview.htm) Software Development Life Cycle