Sunteți pe pagina 1din 11

1

Higher Nationals in Computing

Programming

ASSIGNMENT

No.1

Learner’s Name: LE DUC ANH

Assessor Name: NGUYEN VAN SON

Class: GCS0801B.1
ID: GCS18856
Assignment due: 17/10/2019
Assignment submitted: 16/10/2019

ASSIGNMENT 1 FRONT SHEET


Qualification BTEC Level 5 HND Diploma in Computing

2
Unit number and
Unit 1: Programming
title

Submission date Date Received 1st submission

Re-submission Date Date Received 2nd submission

Student Name Student ID

Class Assessor name

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

Grading grid
P1 M1 D1

❒ Summative Feedback: ❒ Resubmission


Feedback:

Grade: Assessor Signature: Date:


Lecturer Signature:

ASSIGNMENT 1 BRIEF
Qualification BTEC Level 5 HND Diploma in Computing
Unit number and
Unit 1: Programming
Title

3
Assignment title Problem solving with algorithms

Academic Year

Unit Tutor
Submission
Issue date
date

Submission Format:
Format: The submission is in the form of an individual written report and a
presentation. This should be written in a concise, formal business style using
single spacing and font size 12. You are required to make use of headings,
paragraphs and subsections as appropriate, and all work must be supported
with research and referenced using the Harvard referencing system. Please
also provide a bibliography using the Harvard referencing system.
Submission Students are compulsory to submit the assignment in due date and in a way
requested by the Tutors. The form of submission will be a soft copy in PDF
posted on corresponding course of http://cms.greenwich.edu.vn/
Note: The Assignment must be your own work, and not copied by or from another
student or from
books etc. If you use ideas, quotes or data (such as diagrams) from books, journals or
other sources, you must reference your sources, using the Harvard style. Make sure that
you know how to reference properly, and that understand the guidelines on plagiarism. If
you do not, you definitely get fail
Assignment Brief and Guidance:
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) 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

4
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 M1 Determine the steps D1 Examine the


what an algorithm is and taken from writing code to implementation of an
outline the process in execution. algorithm in a suitable
building an application. language. Evaluate the
relationship between the
written algorithm and the
code variant.

Table of contents

Programming.........................................................................................................................................1
ASSIGNMENT.........................................................................................................................................1
1. Problem description...............................................................................................................5
2. Analysis......................................................................................................................................5
3. Use-case Digram.....................................................................................................................5
4. Flowchart...................................................................................................................................6
5. Implementation.......................................................................................................................6
6. Referrences...............................................................................................................................6

1. Problem description
Until I studied IT at FPT Greenwich University, I was an
elementary student. I wrote this program to help them do

5
drawing exercises and calculate the circumference, the area
of the rectangle better

2. Analysis
Input data:
Case 1:
Input cd=5
Input cr=3
Case 2:
Input cd=5
Input cr=3

Output:

Case1:

 * * * * *
* *
* * * * *

Case2:

Perimeter=16

Area=15

3. Use-case Digram

6
4. Flowchart

7
5.Implementation
6. using System;
7. using System.Collections.Generic;
8. using System.Linq;
9. using System.Text;
10. using System.Threading.Tasks;
11.
12. namespace HinhChuNhat
13. {
14. class Program
15. {
16. static void Main(string[] args)
17. {
18. int ok;
19. int cd, cr;
20. do
21. {

8
22. Console.WriteLine("Draw and calculate the
perimeter of a rectangle");
23. Console.WriteLine("1. Draw rectangle");
24. Console.WriteLine("2. Calculate the
circumference, the area of a rectangle");
25. Console.WriteLine("3. Quit");
26. Console.WriteLine("Choose the one you
want to do:");
27. ok = int.Parse(Console.ReadLine());
28. switch (ok)
29. {
30. case 1:
31. {
32. Console.Write("Enter the
length of the rectangle:");
33. cd =
int.Parse(Console.ReadLine());
34. Console.Write("Enter the
width of the rectangle:");
35. cr =
int.Parse(Console.ReadLine());
36. for (int i = 1; i <= cr; i++)
37. {
38. for (int j = 1; j <= cd;
j++)
39. {
40. if ((j == 1) || (j ==
cd) || (i == 1) || (i == cr))
41. {
42. Console.Write(" *
");
43. }
44. else
45. Console.Write("
");
46. }
47. Console.WriteLine();
48. }
49. Console.ReadKey(); break;
50. }
51. case 2:
52. {
53. double P, S;
54. Console.WriteLine("Enter the
length of the rectangle:");
55. cd =
int.Parse(Console.ReadLine());
56. Console.WriteLine("Enter the
width of the rectangle:");

9
57. cr =
int.Parse(Console.ReadLine());
58. P = ((cd + cr) * 2);
59. S = (cd * cr);
60. Console.WriteLine("The
perimeter of a rectangle is:{0}", P);
61. Console.WriteLine("The area
of a rectangle is:{0}", S);
62. break;
63. }
64. case 3: { break; }
65. }
66. Console.ReadKey();
67.
68. } while (ok != 3);
69. }
70. }
71. }

6.Referrences
1.Nguyen Van Son (teachers)
2. https://freetuts.net/hoc-csharp/csharp-can-ban-va-nang-cao [Accessed
16 Oct. 2019].
3. https://o7planning.org/vi/10333/hoc-nhanh-csharp-cho-nguoi-moi-bat-
dau [Accessed 16 Oct. 2019].
4. https://techmaster.vn/khoa-hoc/25560/c-qua-30-vi-du-lap-trinh
[Accessed 16 Oct. 2019].
5. https://vietjack.com/bai-tap-csharp/bai-tap-lenh-if-else-switch-trong-
csharp.jsp [Accessed 16 Oct. 2019].
6. https://vietjack.com/bai-tap-csharp/bai-tap-vong-lap-trong-csharp.jsp
[Accessed 16 Oct. 2019].
7. https://vietjack.com/csharp/tinh_da_hinh_trong_csharp.jsp [Accessed
16 Oct. 2019].

8. https://vietjack.com/csharp/toan_tu_trong_csharp.jsp [Accessed 16 Oct.


2019].

9.
https://drive.google.com/drive/folders/17K2f6xigk5K4x0uNVO3PWo8HslU
rrVyO [Accessed 15 Oct. 2019].

10
10. Books (title of the book: Lap trinh voi C#)

11

S-ar putea să vă placă și