Programing Greenwich_Assignment 2, Study Guides, Projects, Research of Computer science

Programing Greenwich_Assignment 2 2021

Typology: Study Guides, Projects, Research

2020/2021

Uploaded on 09/11/2021

min98
min98 🇻🇳

4.5

(11)

5 documents

1 / 18

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
ASSIGNMENT 2 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
Thái Thị Yến Nhi
Student ID
GCS200207
Class
GES0904_NX
Assessor name
Thái Thị Thanh Thảo
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
Nhi
Grading grid
P2
P3
P4
P5
M2
M3
M4
D2
D3
D4
X
X
X
X
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12

Partial preview of the text

Download Programing Greenwich_Assignment 2 and more Study Guides, Projects, Research Computer science in PDF only on Docsity!

ASSIGNMENT 2 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 Thái Thị Yến Nhi Student ID GCS Class GES0904_NX Assessor name Thái Thị Thanh Thảo 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 Nhi Grading grid P2 P3 P4 P5 M2 M3 M4 D2 D3 D X X X X

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

P2. Explain what procedural, object-oriented, and event-driven paradigms are, as well as their characteristics and relationships:

1. Procedural Programming: a) Definitions: A procedural language is a set of instructions that tells a computer how to do something step by step. Write line after line of code in this developer programming exercise that does one single action each line. The first line of code is executed in procedural programming, then the second, third, and so on. To accomplish something, lines cannot jump from the first to the seventh; instead, they must complete lines 1-6 before moving on to the seventh. According to procedural programming, all algorithms are executed with functions and data that the developer has access to and may change. In procedural programming, programs are executed from the top down. Procedural languages include BASIC, COBOL, PASCAL, FORTRAN, C, and PL1. b) Characteristics: Procedural programming has the following characteristics: ➢ A top-down technique is used in procedural programming. ➢ The program is divided into functions, which are code blocks that perform certain tasks. ➢ Procedural programming represents real-world processes as 'procedures' that run on 'data.' ➢ Data and functions have nothing to do with one another. ➢ In a program, data is free to flow. ➢ The logic of a program is simple to grasp. ➢ By calling another function, a function can get access to that function's data. 2. Object-oriented Programming (OOP): a) Definitions: OOP languages are widely used and may be found in a variety of software programs and games. Consider this scenario: a jet with 300 seats, two wings, two massive rotor fans, and a plethora of controls. If we want to go even more specific, we can make objects out of those 300 seats, and instead of manufacturing them one at a time, we can design the perfect seat once and have the program produce 299 of them in the same way. In OOP programming, this is known as creating an OBJECT. That is the first letter in the acronym OOP.

b) Characteristics: ➢ OOPs is not the same as procedural programming, which is. ➢ In OOPs, the object is the most important unit, whereas in procedural programming, the function or method is the most important unit. ➢ In OOPs, code is stored as an object, whereas in procedural programming, code is organized into discrete operations. ➢ The most crucial characteristic of OOPs is reusability. When opposed to procedural programming, object-oriented programming (OOP) reuses code more frequently. ➢ Abstraction: The goal of programming logic is to keep private data concealed from the outside logic. As a result, compared to procedural programming, OOPs have a higher degree of abstraction. ➢ Encapsulation and polymorphism: Procedural programming does not allow encapsulation and polymorphism. ➢ Inheritance: In OOPs, we may inherit existing functionality from the parent, however inheritance is not supported in procedural programming.

3. Event-driven paradigm: a) Definitions: The event-driven programming approach is a well-known and widely used programming technique. If you have a phone, microwave, toaster, fire alarm, or computer, you've undoubtedly used this in some way. The code will wait for anything to happen, such as a mouse click, starting the engine, detecting smoke, detecting heat on food, or anything else, and then take action based on the EVENT. Is everything starting to make sense now? Although the overall operation is more complex, it follows a similar pattern. A crucial component of event-driven programming is the EVENT LOOP. These loops are needed to monitor the user interface on a regular basis to see whether something has happened, such as a mouse click or a keyboard key press. A programmer may use a variety of loops, and many of the MOOICT classes have addressed how to use clicks, key press events, form load events, and the most important timer events. All of the major GUI programming languages, such as C#, C++, Java, JavaScript, and Objective C, have their own version of event driven programming.

4. Relationship: In procedural programming, a program and its subprograms are specified as a collection of steps. Declarative programs, on the other hand, try to describe the conclusion without regard for the computerization procedures, instead giving a description or denotation of the intended result. To structure code, object-oriented programming concepts such as encapsulation, inheritance, substitution, programming to interfaces, and others are employed. Procedural applications are common in object-oriented applications. What event-oriented programming is all about is writing event handling methods and having the core event loop provided by the underlying system. This eliminates the need to create your own event loop and allows you to take advantage of a variety of libraries that already interact with the system's event loop. Object-oriented programming is commonly used in event-based systems, however that is not always the case. In the end, I chose to use procedural programming to create my application.

P3. Using an IDE, create a program that implements an algorithm: Example: Consumers visit my store on a daily basis and spend significantly more money. The managerial work is becoming increasingly difficult. Then I'll need a program to assist me in running my business.

1. Activities: ➢ Add new components to the mix. ➢ Take a look at the overall amount of items. ➢ Count the number of things in the room. ➢ Calculate the amount of money you'll make. ➢ Look for items. 2. Add products options: ➢ Name ➢ Category ➢ Size ➢ Quantity ➢ Price ➢ Amount ➢ List: a list of books that need to be kept and managed.

4. Coding:

b) Breakpoints: Breakpoints are the points at which the program will halt so that the programmer may examine the changes in the program's state and variables as they pass through each command line, allowing the programmer to locate the problem. A red dot at the start of a line of code indicates a breakpoint. The easiest approach to make a breakpoint is to click at the beginning of a line of code (as shown in the image). Breakpoints can be canceled by simply clicking on them again. You may also use the F9 key to create and cancel breakpoints. c) Watch Windows: When debugging, when the program comes to a halt at a breakpoint, it's important to verify the value of variables, functions, and so on through each line of code to look for problems in the algorithm. Watch windows are a set of tools that allow programmers to keep track of a variable's current value. The Debug Windows menu contains these windows (only appears during debugging).

d) Data Tip: The value of the variable will be shown on the screen when you move the mouse cursor to the variable name anywhere inside the current { } (scope) pair. Then you may "pin" that variable to the screen for easy access, or add it to the Watch window, copy the value, alter the variable's value, and so on. e) Locals: The Locals window will automatically display all variables associated with the current line of code. Each line of code will modify the variables displayed below. Furthermore, the hue of the variables aids us in determining which variables have recently changed values. f) Autos: The Autos pane, like Locals, shows the variables that were utilized in the previous lines of code. Any variables that are no longer needed will be automatically identified and removed from the Autos pane by Visual Studio. g) Watch: Visual Studio is unable to recognize all of the programmer’s requirements. In some instances, such as the 10th member in an integer array or the 5th letter of the Studio Tutorial text, it's important to keep track of a specific value. Using the Watch window is required. It allows programmers to name variables, functions, and other items in the current scope. Variable and function values will be shown next to the variable name.

P5. Make a list of the coding standards you utilized in your code: C# (short for "C Sharp") is a modern object-oriented, general-purpose programming language. It was created by Microsoft as part of the.NET project and was approved by the European Computer Manufacturers Association (ECMA) and the International Standards Organization (ISO) (ISO). C# is one of the languages supported by the Common Language Infrastructure. C# has a syntax that is comparable to Java and is simple to pick up for users who are already familiar with C, C++, or Java. The following are some suggested practices for all. The following guidelines should be followed by web developers:

**1. Pascal Case should be used for all class and method names:

  1. Camel Case should always be used for method arguments and local variables:
  2. Avoid using the underscore "_" when naming identifiers:** 4. To avoid having to use System data types, use Predefined data types instead:

CONCLUSION

My assignment was finished. Because there are many analogous links between them, programmers may rely on the IDE to solve some challenging algorithms quickly, which I feel is quite beneficial. In order to develop today's complex technologies, it is important to understand how to program quickly and correctly.