1618 asm2 networking, Assignments of Computer Science

asm2 1618 effective for everyone

Typology: Assignments

2020/2021

Uploaded on 09/22/2021

nc42131
nc42131 🇻🇳

4.8

(47)

8 documents

1 / 28

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
1
Nguyen Xuan Cong-GCH200253
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
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
P2
P3
P4
P5
M2
M3
M4
D2
D3
D4
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c

Partial preview of the text

Download 1618 asm2 networking and more Assignments 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 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 P2 P3 P4 P5 M2 M3 M4 D2 D3 D

 Summative Feedback:  Resubmission Feedback:

Grade: Assessor Signature: Date: Lecturer Signature:

  • A. INTRODUCTION: Table of Contents
  • B. PROGRAMMING PARADIGM:
    • I. PROCEDURAL PROGRAMMING:
    • II. OBJECT-ORIENTED PROGRAMMING:
    • III. EVENT DRIVEN PROGRAMMING:
    • IV. RELATIONSHIP BETWEEN THEM:
  • C. PROGRAM RESULTS:
    • I. SCENARIO-PROBLEM-SOLUTION:
    • II. FLOWCHART:
    • III. EXPLANATION OF CODES:...................................................................................................
    • IV. RESULT:
  • D. IDE USAGE IN DEVELOPMENT:
    • I. COMMON IDE FEATURES:
    • II. IDE USAGE:
  • E. DEBUGGING:
    • I. DEFINITION OF DEBUG:
    • II. DEBUGGING PROCESS:
    • III. DEBUGGING USAGE IN PROGRAM:
  • F. CODING STANDARD:
  • G. CONCLUSION:
  • H. REFERENCES:
  • Figure 1: Procedural programming. Table of figures:
  • Figure 2: Object-oriented programming.
  • Figure 3: Event driven programming.
  • Figure 4: Login.
  • Figure 5: Main.
  • Figure 6: Login form.
  • Figure 7: Login and Exit button.
  • Figure 8: Main form.
  • Figure 9: Select and Remove buttons
  • Figure 10: Exit, Reset buttons, Form load.
  • Figure 11: Add button.
  • Figure 12: Result.
  • Figure 13: Smart code editing.
  • Figure 14: Debugger.
  • Figure 15: Solution explorer.
  • Figure 16: Debug toolbar..............................................................................................................................
  • Figure 17: Add breakpoints.
  • Figure 18: Run the program.
  • Figure 19: Check the code.
  • Figure 20: Finding logical error.
  • Figure 21: Finding logical error.
  • Figure 22: Result after fix the code.
  • Figure 23: Naming convention.
  • Figure 24: Layout 1.
  • Figure 25: Layout
  • Figure 26; Layout
  • Figure 27: Comments.

A. INTRODUCTION:

The objective of this report is to clarify the definition and the properties of procedural programming, object-oriented programming, and event-driven programming, giving a few fundamental provisions of an Integrated Development Environment (IDE). Additionally, referencing the most common way of utilizing debug and coding standard, how it helped during the development. Likewise, this report will present a program utilizing an IDE: Bookshop System.

B. PROGRAMMING PARADIGM:

I. PROCEDURAL PROGRAMMING:

Procedural programming may likewise allude to a programming paradigm, which is gotten from organized programming dependent on the procedural call concept. Procedures, otherwise called routines, sub routines, methods, or functions, involve a progression of computational strides to be performed. During the execution of a program, some given method can be named at any stage, referring by different function or by itself (Bhatia, 2021). Figure 1 : Procedural programming.

Polymorphism: is a Greek word that signifies “one name for many forms.” All in all, one object has many forms or has one name with various components. “Poly” connotes many structures and “morph” signifies forms. Polymorphism permits a class the option to have a few executions with a similar name. After encapsulation and inheritance, it is one of the core standards of OOP. Abstraction: is one of the core standards for the languages of OOP. The fundamental goal is to manage disarray by concealing superfluous client data.

III. EVENT DRIVEN PROGRAMMING:

Event-driven programming is the paradigm used for graphical user interfaces and different applications. In an event-driven application, there is for the most part a fundamental circle that listens to occasions and afterward triggers a callback function when one of those occasions is identified. The equivalent can be accomplished in installed frameworks utilizing hardware interrupts rather than a constant main loop. Event-driven programs can be written in any programming language, in spite of the fact that work is simpler in high-level languages like pausing and shutting (UKEssays, 2018). Figure 3 : Event driven programming.

Examples about properties (UKEssays, 2018):

  • Time driven: Event-driven programming is time-driven programming that runs on a time trigger. This could be piece of code that runs at a particular time, which could be possible once a week or at whatever point a program is dispatched.
  • Event handlers: An event handler is a function or method that happens when an event happens. They are executed in response to the event.
  • Trigger functions: For every occasion that is probably going to happen, most projects have a trigger element. Trigger functions figure out what code is run when a particular occasion happens.

IV. RELATIONSHIP BETWEEN THEM:

According to (Parsons and Oja, 2012), I realized that there is a connection between Procedural programming, Object-oriented programming, and Event-driven programming. Procedural programming implies you define a program as a progression of steps, just as its sub- program. Conversely, revelatory projects endeavor to portray the result regardless to the means taken to register it but instead some depiction or signification of the desired result. Object-oriented programming is an approach to coordinate code around the standards of encapsulation, inheritance, replacement, interface programming, etc. Object-oriented programs are generally procedural in nature. Event-driven programming is about coding processes for occasion taking care of and having the underlying system give the center event loop. Along these lines, you can save the difficulty of composing your own event loop and advantage from various libraries that as of now work with the event loop provide to the system. Event-driven programs very often compose, yet not continually, utilizing object-oriented style.

C. PROGRAM RESULTS:

I. SCENARIO-PROBLEM-SOLUTION:

I have applied for a post as a trainee with a software development organization and have been invited for an interview. I have been passed the demonstration to exhibit my critical thinking and essential programming abilities. Presently I am given a more test errand to make a completely working, secure application that has been created utilizing an IDE and clings to coding guidelines for a detailed business issue.

Figure 5 : Main.

III. EXPLANATION OF CODES:

Beginning of the program, we will need to login to the program. If you enter correct user name and password, you will go to the main program. If not, the program will close. Here are the codes for login form. The first function is the button login click event, the second is exit button click event. If you click to Exit button, the program will close. If you click to Login button, program will check the username and password you entered. If the username and password you entered are correct, the program will call up a new Main form named “fo”. If false, the program will terminate. Figure 6 : Login form. Figure 7 : Login and Exit button.

Here are the 4 buttons to choose items from lstItemlist. Item you chose from lstItemlist will be added to lstSelected and removed from lstItemlist. Figure 9 : Select and Remove buttons

When the Main form is shown, items will be add to lstItemlist. If you click Exit button, program will end. If you click Reset button, all text from txtName, txtOrder, and txtTotal will be deleted; check box chkCash and chkCreditcard’s check state will be change to unchecked; all items from lstSelected will be removed and added to lstItemlist. Figure 10 : Exit, Reset buttons, Form load.

IV. RESULT:

I run the program then I entered name of customer, choose items form left list box and payment method below. Items chosen was shown in right list box. Then I press Add button, the order information was shown in below text box and total price was shown in total textbox.

D. IDE USAGE IN DEVELOPMENT:

The Integrated Development Environment (IDE) is a software environment that furnishes software engineers with broad programming improvement facilities. IDEs increment developer productivity by consolidating normal activities of composing programming into a solitary application: editing source code, building executables, and debugging (Walker, 2018). Example of the IDEs: .NET. Figure 12 : Result.

I. COMMON IDE FEATURES:

According to Walker (2018), there are several common features of IDE:

  • Smart code editing: your IDE can indent code lines, match words and brackets, and also feature match words.
  • Compiler: are parts that make an interpretation of programming language into a structure machine can measure, like binary code. The machine code is investigated to guarantee its precision. The compiler then parses and optimizes the code to optimize performance.
  • Debugger: debugger tools help clients in distinguishing and curing error inside source code. They frequently simulate true situations to test usefulness and execution. Developers and software programmers can generally test the different sections of code and recognize errors before the application is delivered.
  • Extension/plugin manager: you can add new augmentations/modules to broaden your IDE’s functionality.
  • Solution explorer: add a solution explorer panel where you can track down a Visual Studio Solution File Explorer: can load any .sln version; supports .net core projects; create, delete, rename or more project folders, project files, solution, solution folders, and projects.

II. IDE USAGE:

Here are several IDE features I used in my program: Smart code editing: It help me complete command I’m entering and show what properties is go with variables, what method is gone with object so I can save my time and effort. Figure 13 : Smart code editing.

E. DEBUGGING:

I. DEFINITION OF DEBUG:

Debugging is the method involved with discovering blunders during application execution. It doesn’t mean syntax errors, with which the application can’t be compiled, yet on logical errors. Debugging is utilized to discover and fix program errors or flaws. Once in a while troubleshooting a program takes additional time than coding it. At the point when various subsystems or modules are firmly connected together, bugs can be harder to track down (Stojanovic, 2018).

II. DEBUGGING PROCESS:

According to Jana (2010), here are the steps of debugging process: Breakpoints (a red circle) are areas where the program will stop and afterward the software engineers can watch variables changes through each command line, in this way distinguishing the area of error lines of code. The easiest way to make a breakpoint is by tapping on the start of the code line. To drop a breakpoint simply click again on the breakpoint. You can likewise make/drop breakpoints utilizing the F9 key, as well. Run the program: Thus, a program will take a gander the code in its fundamental function. There are especially “straight” sections, there are “branching” fragments (if/switch), there are “loops” segments (for/while/…), there are more modest sections (functions). To fix the error of the program, it is important to discover its “tangles”, that is figuring out where mistakes are probably going to be produced by the code. Watch windows: In the debug process, after the program stops at a breakpoint, we need to genuinely take a look at the difference in upsides of variables, functions, and so forth through each line of code to see error in the algorithm. Watch window is an assortment of tools that assist software developer with monitoring the value of the current variable. These windows can be found in the menu Debug->Windows (just show up while debugging is in progress). Data tip: At the point when you move the mouse pointer anyplace inside the current {} (scope) to a variable name, the value of the variable will show up on the screen. In the interim, for simple survey, you can “pin” that variable on the screen, or add it to Watch window, duplicate the value, change the variable’s value, … Locals: The locals window will consequently show all variables related with the current line of code. Variables displayed here are changed by each line of code. The color of variables further assists us with understanding those that have quite recently changed the value. Autos: As with locals, the Autos window shows the variable are at this point no needed and eliminates them from the Autos window.

Watch: Visual Studio can’t distinguish all which a developer requires. Sometimes, a particular value should be followed, for example, the tenth component in a number exhibit or the fifth person of the “Studio Tutorial” string, and so on we should utilize this to the Watch window. It permits software engineers to enter explicit variable names, functions, and so forth in the current degree. The value of the variable and function will show close to the name of the variable. Debug the program: you need to make the fundamental breakpoints to discover and fix errors in the program prior to troubleshooting. To begin debugging a program, go to the menu Debug-> Start Debugging or press F5 on the console. The program will be worked by Visual Studio. The Debug window will show up after the form is finished and there is no aggregate error. In case there are no orders waiting for data section will stop the screen, the program will stop at the first breakpoint. A Debug toolbar will show up. There are significant instrument fastens as follows (from left to right is step into, step over, step out):

  • Step over: run bit by bit, skim the function (only get the return value of the function).
  • Step into: run bit by bit, get into the substance of the sub-functions.
  • Step out: “Jump” to the following breakpoint. In case there are no more breakpoints, it will end debugging. What’s more, it likewise has the function to run through the current sub-function. Figure 16 : Debug toolbar.